Using Dimension Hierarchies

Dimension hierarchies enable you to create complete visualizations with powerful drill down capability within a single visual, instead of relying on a complex interaction of two or more visuals inside an app.

Dimension hierarchies can be used with bar, line, area, and grouped bar visual types.

We also provide an alternate solution for hierarchical dimension representation in cross-tab visuals.

The following steps demonstrate how to use Region, a dimensional hierarchy based on dataset World Life Expectancy [data source samples.world_life_expectancy], to build a bar chart that can switch between representations at three different levels of data granularity. To create this hierarchy, see Creating New Dimension Hierarchies.

  1. Start a new bar visual on the World Life Expectancy dataset.

    See Bar Visuals.

  2. In the Visual Designer interface, populate the shelves of the visual:

    • Under Dimensions, select the field Region (which is a dimensional hierarchy), and drag it onto the X Axis shelf.
    • Under Measures, select population and drag it onto the Y Axis shelf.
    shelves of bar chart that uses hierarchy
    Building a Bar Chart with Hierarchies
  3. Click Refresh Visual.

  4. The bar chart appears.

    Note that the legend along the X axis corresponds to the top level of the Region hierarchy, un_region.
    initial hierarchy graph
    Bar Chart with a Hierarchy, at Top Level
  5. Change the title to World Population - Hierarchy.

  6. At the top left corner of the Visual Designer, click Save.

  7. Click Close to switch to View mode, so you can examine the operation of the dimensional hierarchy in the visual.

  8. Put the pointer over one of the data labels along the horizontal axis, and note that it changes color; this is because the data labels are link-enabled. Click on one of the choices to drill down to a lower level of the hierarchy.

    In the following graphic, we drilled down from Level 1: un_region = 'Americas', to Level 2: un_subregion = 'South America', and then to Level 3: country.

    Note that every time you move between the hierarchy levels, the scale of the vertical axis adjusts automatically.

    navigating down the hierarchy
    Drilling Down the Dimensional Hierarchy Levels
  9. Similarly, put the pointer over the label of the horizontal axis, and note that it change color; it is also link-enabled. Click the horizontal axis label to go up the hierarchy levels.

    In the following graphic, we moved from Level 3: country where un_region = 'America' and un_subregion = 'South America' to Level 2: un_subregion = 'South America' where un_region = 'America', and then to Level 1: un_region.

    navigating up the hierarchy
    Moving Up the Dimensional Hierarchy Levels