My org has a need to build a data warehouse in SQL Server (and eventually a cube in SSAS) where one of the fact tables is for sale target / budget data.
Till date, I've only handled the opposite of this problem, whereby sum of children's values is less than sum of parent's value.
Here the question is how to model fact table where sum of children's value being n-times sum of parent's value.
The following table representation is the best way I can describe the problem.
Every employee has a sale target / budget amount, as given below:
EmployeeId | EmployeeBudgetAmount$
-----------+----------------------
Emp1 | 100
Emp2 | 200
Emp3 | 500
The above budget value at employee level is split into the practices (an organizational term equivalent to legal practices, such as immigration, corporate, etc.) as given below:
EmployeeId | PracticeTypeId | PracticeId | EmployeePracticeBudgetAmount$
Emp1 | PracType1 | Prac1 | 20
Emp1 | PracType1 | Prac2 | 80
Emp1 | PracType2 | Prac10 | 40
Emp1 | PracType2 | Prac20 | 60
Emp1 | PracType3 | Prac100 | 30
Emp1 | PracType3 | Prac200 | 70
Emp2 | PracType1 | Prac1 | 160
Emp2 | PracType1 | Prac2 | 40
Emp2 | PracType2 | Prac10 | 80
Emp2 | PracType2 | Prac20 | 120
Emp2 | PracType3 | Prac100 | 140
Emp2 | PracType3 | Prac200 | 60
Emp3 | PracType1 | Prac1 | 0
Emp3 | PracType1 | Prac2 | 500
Emp3 | PracType2 | Prac10 | 100
Emp3 | PracType2 | Prac20 | 400
Emp3 | PracType3 | Prac100 | 200
Emp3 | PracType3 | Prac200 | 300
An employee's total budget is met across every practice type's budget for that employee.
Emp1's total budget = SUM(Emp1's practice budget) for PracType1
Emp1's total budget = SUM(Emp1's practice budget) for PracType2
Emp1's total budget = SUM(Emp1's practice budget) for PracType3
...and so on.
If the practice budget table (2nd table above) is used for the fact table, then aggregating all EmployeePracticeBudgetAmount for an employee results in a budget amount that's 3 (number of practice types available) times the budget of an employee.
Any pointers / ideas on how to model this as a fact table?
Thanks in advance.
NOTE: There are other dimensions such as fiscal month and fiscal year, above the level of employee, across which the budget amount would need to be summarized. I've not presented those in the above question for brevity reason.