Database Reference
In-Depth Information
Adding dimensions with parent-child hierarchies
In the previous examples, you have worked with normal user-defined hierarchies,
such as the product hierarchy that you have created in the product dimension. In
the following example, you will create a special kind of hierarchy, that is, a parent-
child hierarchy. A
parent-child hierarchy
describes a self-referencing table. In the
example database you have the
DimEmployee
table.
The
DimEmployee
table contains
EmployeeKey
that is defined as the Primary Key
of the table. Then you have the
ParentEmployeeKey
column that is defined as a
Foreign Key referencing the
EmployeeKey
column of the same table.
To create the employee dimension, perform the following steps:
1. Right-click on the
DimEmployee
table in the Data Source View and select
the
New Named Calculation
option.
2. Name the new calculation as
FullName
and add the following calculation:
[FirstName] + ' ' + [LastName]
3. Right-click on the
Dimensions
folder in the
Solution Explorer
and select
New Dimension
.
4. Click on
Next
, choose
Use an existing table
, and then click on
Next
again.
5. Configure the
Dimension Wizard
as shown in the following screenshot:
Search WWH ::
Custom Search