Parent-Child Sales Aggregation Issue
Hi Team,
Lets say we have sales at parent level in base dataset1 and same is assigned to the corresponding children in dataset2. The total sales should remain 60 even when displayed at child level but Pyramid aggregates the sales for each row and shows 120.
Is there a workaround/steps to maintain the aggregation grand total at parent level even when we have both Parent and child on the same grid visual?
DataSet1
| Parent | Sales |
| A | 10 |
| B | 20 |
| C | 30 |
Dataset 2
| Parent | Child | Sales |
| A | 1 | 10 |
| A | 2 | 10 |
| B | 3 | 20 |
| B | 4 | 20 |
| C | 5 | 30 |
| C | 6 | 30 |
2 replies
-
Hi
Firstly, I would question your data modelling here. Presented with your dataset 2 as a table, all database systems will return 120 for the total Sales. How could it do otherwise?
Secondly, you use the terms Parent / Child. Do you mean a Parent / Child Hierarchy? If so there are options for how to aggregate the data in your model using unary operators, see Help for details.
Thirdly, if the data exists as two tables, then reversing the direction of join, from dataset 2 to dataset 1, WILL produce the correct results, but it may not be correct for other situations. You'll also lose the relationship between parent and child:

Hope that helps.
Ian


