Parent-Child Hierarchy
What's the best way to represent a Parent-Child hierarchy in the Cube? I've seen the Usage that can be applied as Parent. I've applied this, for example,
ID ParentID CompanyName Rank
1 1 AAA Excellent
2 1 BBB Good
3 1 CCC Ok
4 1 DDD None
I can link the ID and ParentID Usage appropriately by setting the ParentID to a Usage of Parent. I've also set the Parent Key, so that if the Company rolls up to itself, it doesn't show the Parent as its own child (NonLeafDataHidden).
When using only the CompanyName in the Cube Browser / Excel, this is working okay.
The problem occurs when trying to bring in other attributes, such as Rank.
Dragging the following into the Cube Browser:
- (Parent Company, Company...hierarchy), Rank - If the Rank is at the end of the table, Cube Browser doesn't show the Rank column at all, only the heading appears.
- Rank, (Parent Company, Company...hierarchy) - If the Rank is at the start of the table, Cube Browser displays correctly.
In Excel, - (Parent Company, Company...hierarchy), Rank - If Rank is at the end of the table, Excel doesn't display the Rank of the Parent Company, but does display the Rank of the Child Companies on a second line. By displaying the Rank on a second line - any measures also get repeated:
AAA 73 - here for AAA the Rank is not showing. The measure is correct, 23 from the Child and 50 for the Parent
BBB 10 - repeated measures 10
Good 10
CCC 8 - repeated measures 8
Ok 8
DDD 5 - repeated measures 5
None 5
- Rank, (Parent Company, Company...hierarchy) - If Rank is at the start of the table, Excel groups correctly and sums correctly. Although, the Parent Company will still appear in each of the Ranks, as it has children that are in that particular Rank, but the Measures will only be from the Children that are in that Rank.
What is the Best way to bring Attributes of a Parent-Child Hierarchy? From the issues I've seen above, I'm tempted to go a create a new Table (Parent Company) using Named Query and join to this directly with the ParentID - effectively Aliasing.