Let's say i have the following hierarchy that i use as a dimension:
- Root
- A1
- B11
- B12
- ...
- B1N
- B1Special
- A2
- B21
- B22
- ...
- B2N
- B2Special
- ...
- AM
- BM1
- BM2
- ...
- BMN
- BMSpecial
Let's say i have the following hierarchy that i use as a dimension:
Copyright © 2021 Jogjafile Inc.
I have to assume you want to see the sum of all 'Special' nodes only once, at the root level. In other words, you want to see just one number in your results set.
Assuming the hierarchy detailed in your original question was called 'Bob', and you had another dimension called 'Kate', you might try this...
This creates a new, temporary, member in the Bob dimension, which is an aggregation of several other members in the Bob dimension. We start with all the members that sit in one particular level. The
Filterchooses only those members which have the word "special" in their name.Note that
InStris a VBA function which is supported by Microsoft SSAS. It returns zero if the chosen string is not found. Alternative string searching functions may be available in other flavours of MDX.You then use this new member in your
WHEREclause, and slap your other dimensions/measures wherever you want.