Learn About Hierarchies

Hierarchies let you structure your data.

You can create hierarchies during the data preparation stage, or within the modeler after you’ve created a model. Creating hierarchies during the data preparation stage instead of in the Modeler is faster and more automated. However, to make adjustments, or to add or delete members from the hierarchy, you'll need to use the Modeler.

Levels-based hierarchies

A level-based hierarchy organizes the members of a dimension into levels, such as Country, State, and City.

You can add level-based hierarchies to generic dimensions and organization dimensions by selecting a dimension, and then from the Dimension Settings panel, selecting Start of the navigation path Next navigation step Create Hierarchy Next navigation step Level-Based HierarchyEnd of the navigation path.

You then define your level-based hierarchy in the Hierarchy Builder. Click to create a new hierarchy. Name it, and then select the dimension columns to use for creating the hierarchy. Select again to create more hierarchies. At any time, you can select the icon beside Hierarchies in the Dimension Settings panel to create, edit, and delete level-based hierarchies.

Parents-based hierarchies

A parent-child hierarchy organizes the members of a dimension into a set of parent-child relationships.

You can add parent-child hierarchies to generic dimensions and organization dimensions by selecting a dimension, and then from the Dimension Settings panel, selecting Start of the navigation path Next navigation step Create Hierarchy Next navigation step Parent-Child HierarchyEnd of the navigation path.

When you add a parent-child hierarchy, a new column is inserted into the grid. Add the parent ID values to the hierarchy column (). Select beside Hierarchies in the Dimension Settings panel to create more hierarchies.

To see a parent-child hierarchy's structure, open the Hierarchy Maintenance view by selecting one of your parent-child hierarchies in the Dimension Settings panel. Here, you can drag members to build the parent-child relationships visually. If more than one hierarchy has been defined, you can select which one to work with from the drop-down list.

Hierarchies in other dimension types

Other types of dimensions don't support custom hierarchies:

  • The Account dimension has only a single hierarchy.
  • For the Date dimension, hierarchies are predefined based on the model granularity, and whether you've enabled fiscal time for the model. You can specify a default hierarchy in the settings for the Date dimension.
  • The Version dimension doesn't have a hierarchy, since different versions are separate and don't have parent-child relationships.
Parent-child hierarchies with a subset of members

In some situations, you might want to create a parent-child hierarchy for a dimension, but not want to include all of the dimension members in the hierarchy. When you add a parent-child hierarchy to a dimension, an extra member is automatically added to the dimension, named “Not In Hierarchies” by default. Any members that you don't add to the hierarchy (that is, they don't have a value in the hierarchy column) are assigned as children of the “Not In Hierarchies” member.

Depending on which parent-child hierarchy is being shown in a table, different members will be under the “Not In Hierarchies” parent member.

For more information, see Entering Values with Multiple Hierarchies.

Note
  • If you remove a member from the hierarchy, that member and all of its descendants are moved to the “Not In Hierarchies” node, as a flat list. Any previously existing sub-trees are discarded.
  • If you delete a member from the dimension, and it has descendants in a parent-child hierarchy, the descendants are moved to the “Not In Hierarchies” node.
  • If you decide to assign all of the dimension members to all parent-child hierarchies, or delete all of the parent-child hierarchies, you can remove the “Not In Hierarchies” member by switching off Allow hierarchies with a subset of members in the Dimension Settings panel.
  • You can adjust the properties of the “Not In Hierarchies” member, except its position in the hierarchy (it's always assigned to root).
Managing hierarchies

The Hierarchy Maintenance screen lets you manage hierarchies visually. It displays an icon () next to members that belong to the selected parent-child hierarchy. You can also use the All/In Use switch to display either all members of the dimension, or only members of the selected hierarchy.

Creating a Parent-Child Hierarchy

Use parent-child hierarchies to structure your data into parent-child relationships. When the data is displayed in a story, hierarchies can be expanded or collapsed.

  1. Start creating your model. After the data import, you can see the data integration view where you perform data preparation before creating a model.

  2. Select the column that you want to be the child in the parent-child hierarchy.

    For example, if you're creating a geography hierarchy, with Country as the parent and City as the child, select the City column. Note that you can change the column name by double-clicking the column header.

  3. In the Details panel, select Add Dimension Attributes.

  4. Select Parent-Child Hierarchy (Parent).
  5. In the Select parent list, choose the column that you want to be the parent in the hierarchy.

    The column's icon changes to show that it's now the parent in the hierarchy.

  6. Repeat the above steps if you want to create more parent-child hierarchies.
    Note

    The parent and child columns don't need to represent levels in a hierarchy. For example, if you're setting up a hierarchy similar to a company org chart, the columns could contain data like this:

    Child Parent
    John Mary (John's manager)
    Pierre Mary (Pierre's manager)
    Mary Joanna (Mary's manager)
    Kevin Joanna (Kevin's manager)
    Otto Kevin (Otto's manager)
    Note
    If a column is mapped to a hierarchy parent of a dimension, an empty cell in that column means that the corresponding dimension member doesn't have a parent in that hierarchy. In other words, that member is a top-level node of the hierarchy.

    For example, if you have the following columns, the resulting hierarchy will have A as the top-level node, with two child nodes A1 and A2:

    Product (child) Product group (parent)
    A1 A
    A2 A
    A  

    The dimension member A still belongs to the hierarchy. If you want a newly created dimension member to be excluded from a hierarchy of that dimension, don't map the hierarchy to a column.

  7. Select Create Model.

    In the Modeler, you now see the dimensions and attributes of your model, including the hierarchy you created. If you want to make any changes to the hierarchy, see the following steps.

Creating a Level-Based Hierarchy
Use level-based hierarchies when your data is organized into levels, such as Product Category, Product Group, and Product. When the data is displayed in a story, hierarchies can be expanded or collapsed.
  1. Start creating your model. After the data import, you can see the data integration view where you perform data preparation before creating a model.
  2. In the toolbar, select (Level Based Hierarchy).
  3. In the Hierarchy Builder, type a name for the hierarchy.
  4. Select dimensions to build your hierarchy.

    You can drag the column tokens to change the order of the levels.

  5. Select Generate a 100% unique bottom level for my hierarchy if the data values in the lowest level don't correspond to unique dimension member IDs; in other words, a single dimension member has multiple hierarchy parents.

    For example, let's say you want to build a dimension with a level-based hierarchy using these two columns:

    City Country
    Vancouver Canada
    Vancouver USA
    Seattle USA

    When you create the hierarchy, a new column is generated, with unique values that serve as the dimension member IDs:

    City-ID City-Description Country
    Vancouver-Canada Vancouver Canada
    Vancouver-USA Vancouver USA
    Seattle-USA Seattle USA

    Note that when you subsequently import data into this model, this dimension member ID needs to be mapped from the imported source data as well. If the source data doesn't already have a column that contains such values, you can generate the dimension IDs again by selecting the card that represents the dimension member IDs of the dimension, and selecting Generate and Map the Unique ID.

  6. Select OK when finished.

    To see detailed information about the new hierarchy, select the hierarchy column. Information is shown in the Details panel.

  7. If you want to add more level-based hierarchies, or copy, edit, or delete a hierarchy, select (Level Based Hierarchy) to open the Hierarchy Builder again.
  8. When you've finished creating hierarchies, select Create Model.
  9. In the Modeler, switch to the Model view.

  10. Open a dimension that you've created a level-based hierarchy for.

    You'll see the hierarchy you created in the Dimension Settings panel. If you want to make any changes to the hierarchy, select the hierarchy to open the Hierarchy Builder.

If you want to create a hierarchy or make any changes to the hierarchy within the Modeler, switch to the Model view, open a generic or an organization dimension and open the Dimension Settings to create a new hierarchy. In the Hierarchy Builder, give a name to the hierarchy and select columns to build the hierarchy. In the Hierarchy Management screen, you can also add more level-based hierarchies, or copy, edit, or delete a hierarchy. If other level-based hierarchies already exist, select one of them to open the Hierarchy Builder.
Video: How to Create Hierarchies in Datasets and Models

Open this video in SAP Media Share

In this video you will drill down between hierarchical levels in a story, create a level-based hierarchy in a dataset, create a level-based hierarchy in a model, create multiple parent-child hierarchies in a model, and choose how to display a non-default hierarchy in a story.