Question

I have a fact table with columns Product Model and measure Installed base(not important, any other measure would do the same).

Than I have dimension table, and here comes the tricky part:

I have many product models, and each belong to higher level custom_groups (4 in total), Same product model may belong to more than one custom groupX, and custom groupX may belong to more than one custom groups X-1.

for example hierarchy from highest CG1 to lowest PM Level:

  • XXX=>YYY=>ZZZ=>WWW
  • LLL=>MMM=>QQQ=>WWW
  • RRR=>PPP=>QQQ=>TTT

you can see, that last level PM WWW belongs to 2 different custom groups 3 (QQQ and ZZZ) whereas custom group 3 QQQ may belong to two different custom groups 2 (MMM and PPP in this case).

I tried to model this via hierarchies in SSAS but either I got wrong measure results (IB is summed up without aggregations and results are same for all custom groups), or I get missing some custom groups in my hierarchy.

Was it helpful?

Solution

You can solve this using a many-to-many relationship: Create a dimension table with four columns for the four custom group levels, as well as a custom_group_id column. Fill in to this table all combinations of custom groups that appear in your data. Then build a bridge table (aka factless fact table) with the two columns product_model and custom_group_id. Fill a record into this for each group combination that a product belongs to.

Then, in BIDS create a dimension from the custom group table, and a measure group from your bridge table, using count as the only measure, and make this measure invisible. Finally in the "Dimension Usage" tab of Cube Editor, configure the relationship between the main measure group and the custom group dimension to be many-to-many via the bridge measure group.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top