Get a collection that is typically used to filter out a custom set, such as a restaurant in China
The set returns all products that are msdnteam under and recorded on the fact thread metric.
Implemented with exists
Select
Exists (
[Dim Queue]. [Product-queue]. Members,
[Dim Engineer]. [Team-engineer]. [Team NAME].&[MSDN],
"Fact Thread"
)
On 0 from Palladium
Implemented with filter
Select
Filter
(
([Dim Engineer]. [Team-engineer]. [Team Name].&[msdn],[dim Queue]. [Product-queue]. Members),
[Measures]. [Incoming thread number] > 0
)
On 0 from Palladium
The set returned by filter has two levels, and the queue and team
The set returned by exists is only the queue level. The result set returned by exist is relatively clean.
But the disadvantage of exists is that it can only be judged whether a measure group has a value in this dimension, but not a specific value.
If many of us filter on specific values and just want to return a set of one dimension, we need to synthesize both approaches.
Select
Filter (
Exists (
[Dim Queue]. [Product-queue]. Members,
[Dim Engineer]. [Team-engineer]. [Team NAME].&[MSDN]
, "Fact Thread"
)
, [Measures]. [Incoming thread number] > 0
)
On 0 from Palladium
I hope this article will help you.
The difference between filter and exist in MDX