[Mondrian] [MDX] How to find the current hierarchy

Pedro Alves pmgalves at gmail.com
Thu Dec 22 12:27:36 EST 2011

I'm clueless here. I have D with H1 (default hierarchy) and H2. How can 
I know / query the hierarchy I'm querying without knowing it?

1. With member [Measures].[currentHierarchy] as
2. [D].currentMember.hierarchy.name
3. select Union( [D].children, [D.H2].children, ALL ) on 0
4. [Measures].[currentHierarchy] on 1
5. from [foo]

The above query returns the default hierarchy for D. If I change line 2. 
to [D.H2].currentMember.hierarchy.name, then I'll get "H2" everywhere.

Isn't there a way to find something like "currentHierarchy"? What's the 
best approach to this?


More information about the Mondrian mailing list