[Mondrian] order of measures and hierarchize()

Paul Stoellberger p.stoellberger at gmail.com
Tue Jan 11 16:45:46 EST 2011


the olap4j query model and since a while jpivot as well use hierarchize() in combination with .Children to drill position if more than one dimension is on the same axis.

While with normal dimension i would expect that Hierarchize() defines the order of members appearing in the result, but for Measures this is not so much expected.

So a sample query (from jpivot) would look like:
select NON EMPTY Hierarchize(Union({([Measures].[Sales], [Time].[All Years])}, Union(Crossjoin({[Measures].[Quantity]}, {[Time].[All Years]}), Crossjoin({[Measures].[Quantity]}, [Time].[All Years].Children)))) ON COLUMNS,
  NON EMPTY Hierarchize(Union({[Markets].[All Markets]}, [Markets].[All Markets].Children)) ON ROWS
from [SteelWheelsSales]

I have selected Sales to be the first measure on the columns axis (in the jpivot OLAP navigator i specifically set the order of measures) but Hierarchize() is breaking that order and selecting Quantity as the first Measure.
In saiku (previously known as PAT) we are enabling users as well to define the order of Measures selected (through olap4j query model) but obviously we are facing the same problem there.

As far as I know  Mondrian considers the correct order of Measures to be as they are defined in the schema. So in this case Quantity is defined first in the steelwheels.mondrian.xml, thats why it appears first.

Would you consider this behaviour to be a bug?
If this is expected behaviour, is there any way we can circumvent it somehow?


More information about the Mondrian mailing list