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

Incorrectly rendered ragged hierarchy (if parent member shown) #76

Closed klaudiusz223 closed 11 years ago

klaudiusz223 commented 11 years ago

Result of following query is incorectly rendered if "show parent" option is set

SELECT NON EMPTY {[Measures].[Unit Sales]} ON COLUMNS, NON EMPTY Hierarchize(Union(Union(Union({[Geography].[Canada], [Geography].[Israel], [Geography].[Mexico], [Geography].[USA], [Geography].[Vatican]}, [Geography].[Israel].Children), [Geography].[Mexico].Children), [Geography].[USA].Children)) ON ROWS FROM [Sales Ragged]

mysticfall commented 11 years ago

@klaudiusz223 Thanks for the reporting this. It results from the fact that child members of '[Geography].[Israel]' is not direct decendents of that level.

I'm investigating if such a cube configuration is legal or not.

mysticfall commented 11 years ago

It seems that it's legal, as mentioned here on 'ragged'dimensions :

klaudiusz223 commented 11 years ago

Definitely it is legal.

You can check it in mondrian documentation - hideMemberIf attribute http://mondrian.pentaho.com/documentation/xml_schema.php#Level.

Additionally you can look at parent child hierarchies. Something is also wrong.

SELECT {[Measures].[Number of Employees]} ON COLUMNS, Hierarchize(Union(Union(Union({[Employees].[All Employees]}, [Employees].[All Employees].Children), [Employees].[Sheri Nowmer].Children), [Employees].[Sheri Nowmer].[Derrick Whelply].Children)) ON ROWS FROM [HR]

mysticfall commented 11 years ago

@klaudiusz223 Thanks very much for finding them. I've filed a separate issue for parent-child hierarchies here : #77 .

I think they are quite major limitations with the project, so I'm gonna deal with them immediately.

klaudiusz223 commented 11 years ago

IMO you are absolutely right. Since jpivot isn't under active development it is quite big problem if someone needs open source tool that supports ragged nad parent child hierarchies. For exampele saiku has even bigger problems with such hierarchies.

mysticfall commented 11 years ago

What I found so far :

  • Olap4j's ragged member object does not contain any reference to its parent or ancestors.
  • But it could be workarounded by using 'PARENT_UNIQUE_NAME' property instead.
  • However, both the parent and child's unique name is wrong, and it cannot be used in OLAP operation at all. For example, unique name of the Haifa member is reported to be [Geography].[Israel].[Israel].[Haifa] but actually it is just [Geography].[Israel].[Haifa].

I suppose we can get around this problem with some ugly hacks. But before this, I'll check if it is indeed an intended behavior from Olap4J or Mondrian.

mysticfall commented 11 years ago

Unique name problem seems to be a Mondrian issue: