MDX Documentation

Parent/Child Hierarchy

This is also a classical way of defining OLAP hierarchies. Here the member parent-child relationship is defined explicitly with an id and a parent_id column. This type of dimension does not need the levels defined in advance.

Example

Let's use the same simple dimension data we used for the multi-level example. As you can see the data does not implicitly define the level of each member. Only id, parent_id, as well as name, are needed to define the structure.

        id, parent_id, name    , key
        1 ,          , Europe  ,
        2 ,          , America ,
        3 , 1        , France  , FR
        4 , 2        , United States     , US
        5 , 2        , Canada  , CA
        6 , 2        , Mexico  , MX
    

1) After creating the new table, defining the [Geography] dimension is just a step away:

OLAP Parent/Child hierarchy

2) And this is all we need to define our simple [Geography] dimension. We can now check the results on the dimension browser:

OLAP Parent/Child hierarchy

Next chapter: Path Dimensions