Sql-server – Displaying parent attributes alongside child attributes

hierarchysql-server-2005ssas

SSAS – Parent Child hierarchy – displaying other Parent attributes alongside Child Attributes

For example:

Employee Table

+-----+-------+------+---------------+
| KEY | NAME  | ROLE | MANAGERKEY    |
+-----+-------+------+---------------+
|   1 | John  | CAO  |             1 |
|   2 | Adam  | Emp  |             1 |
|   3 | Steve | CAO  |             3 |
|   4 | Colin | Con  |             3 |
|   5 | Tony  | Con  |             3 |
+-----+-------+------+---------------+

I've setup the Parent-Child relationship in the Dimension.

In Excel, when using Tabular view, I am able to see the following:

+-------------+-------+------+
| MANAGERNAME | NAME  | ROLE |
+-------------+-------+------+
| John        | John  | CAO  |
| Adam        |       | Emp  |
| Steve       | Steve | CAO  |
| Tony        |       | Con  |
| Colin       |       | Con  |
+-------------+-------+------+

I would like to see the Manager Role in the following, is this possible?

+-------------+-------+------+------------+
| MANAGERNAME | NAME  | ROLE | MANAGEROLE |
+-------------+-------+------+------------+
| John        | John  | CAO  | CAO        |
| Adam        | Emp   | CAO  |            |
| Steve       | Steve | CAO  | CAO        |
| Tony        |       | Con  | CAO        |
| Colin       |       | Con  | CAO        |
+-------------+-------+------+------------+

+-------+------+------------+
| NAME  | ROLE | MANAGEROLE |
+-------+------+------------+
| John  | CAO  | CAO        |
| Adam  | Emp  | CAO        |
| Steve | CAO  | CAO        |
| Tony  | Con  | CAO        |
| Colin | Con  | CAO        |
+-------+------+------------+

Best Answer

No, you can't.

As you currently have your Employee table, you can't have a Manager Role attribute for an employee.

To have a Manager Role attribute, you'd have to add a ManagerRole column to your Employee table:

Key  Name   Role  ManagerKey  ManagerRole
---  -----  ----  ----------  -----------
1    John   CAO   1           CAO
2    Adam   Emp   1           CAO
3    Steve  CAO   3           CAO
4    Colin  Con   3           CAO
5    Tony   Con   3           CAO

... so that you could define a Manager Role attribute on your Employee dimension.