mysticfall / pivot4j

Pivot4J provides a common API for OLAP servers which can be used to build an analytical service frontend with pivot style GUI.
Other
128 stars 101 forks source link

Hierarchy order not preserved when removing the '(All)' level. #73

Closed mysticfall closed 11 years ago

mysticfall commented 11 years ago

Removing the '(All)' level of the 'Product' hierarchy results in changing order of hierarchies in the row axis.

SELECT {[Measures].[Unit Sales]} ON COLUMNS, Union(Union({([Product].[All Products], [Gender].[All Gender])}, Union(Union(CrossJoin({[Product].[Food]}, {[Gender].[All Gender]}), CrossJoin({[Product].[Food]}, {[Gender].[F]})), CrossJoin({[Product].[Food]}, {[Gender].[M]}))), Union(Union(CrossJoin({[Product].[Non-Consumable]}, {[Gender].[All Gender]}), CrossJoin({[Product].[Non-Consumable]}, {[Gender].[F]})), CrossJoin({[Product].[Non-Consumable]}, {[Gender].[M]}))) ON ROWS FROM [Sales]
mysticfall commented 11 years ago

It's caused by the fact that PlaceLevelsOnAxes.removeMember() relies upon PlaceMembersOnAxes.findVisibleMembers(Axis) which returns a list that only includes each member only once.