I have a dimension called [Band]
and it can have several different values:
[Band].&[A]&[Under $400]
[Band].&[B]&[$400 - $1,000]
[Band].&[C]&[$1,000 - $2,500]
[Band].&[D]&[$2,500 - $3,500]
...
I'm trying to write a query where I can cut by a sublist of these values.
Here's the query that is not working because the .isin
function doesn't exist in MDX, but you'll see what I'm trying to do:
SELECT
NON EMPTY {[Measure A], [Measure B]} ON COLUMNS,
NON EMPTY {([Band].isin(['Under $400', '$400 - $1,000']).ALLMEMBERS)} --fail on .isin(
DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS
FROM (
SELECT
({[Foo].&[Bar]}) ON COLUMNS
FROM
[CUBE]
)
Now, here's a query that is working, but it only gives me one [Band]
value:
SELECT
NON EMPTY {[Measure A], [Measure B]} ON COLUMNS,
NON EMPTY {([Band].&[A]&[Under $400])}
DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS
FROM (
SELECT
({[Foo].&[Bar]}) ON COLUMNS
FROM
[CUBE]
)
This returns a valid result of:
Measure A Measure B
Under $400 1795.67% 58.48%
But I'd like to see results where it returns the aggregated values of multiple [Band]
dimension values. How can this be done in MDX?
As you can probably tell I've never used MDX before, but as I search on this issue I see things like taking the intersect, or using ChildrenSet. But it doesn't seem very intuitive.
Can you point me in the right direction?