We have a staff dimension that has a self-reference for managers (Parent-Child relationship) that we built the hierarchy on it.
DimStaff table:
| SurrogateKey | BusinessKey | Employee Name | ManagerBusinessKey | StartDate | EndDate |
| 1 | 1 | Manager1 | NULL | 2013-01-01 | 2099-01-01|
| 2 | 2 | Manager2 | NULL | 2013-01-01 | 2099-01-01|
| 3 | 3 | Employee1 | 1 | 2013-01-01 | 2014-01-01|
| 4 | 3 | Employee1 | 2 | 2014-01-02 | 2099-01-01|
Fact Table:
| StaffKey | DateKey | Measure1 |
| 3 | 20130405 | 10 |
| 4 | 20140203 | 20 |
Now, with this data set as an example, the requirement is to
1- Be able to drill down through the hierarchy
Manager1
-> Employee1
-> Measure1=10
Manager2
-> Employee1
-> Measure1=20
2- Aggregate the values for each hierarchy level when one person is selected
Employee1 -> Measure1=30
How can we go about doing that? (the problem is we built it but the second requirement doesn't work because the cube accepts the two states of Employee1 as two separate enities and wont aggregate them.)
ManagerSurrogateKeyto the dimension table and use that to define the self reference. - FrankPl