Working with 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.

Data Visualization also provides an alternate solution for hierarchical dimension representation in cross tabulation visuals. See, Working with Hierarchical Cross-Tabulation 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.
    For more information, see Bars.
  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.
  3. Click Refresh Visual.

    The bar chart appears.

    The legend along the X axis corresponds to the top level of the Region hierarchy, un_region.

  4. Change the title to World Population - Hierarchy.
  5. Click Close to switch to View mode, so you can examine the operation of the dimensional hierarchy in the visual.
  6. 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 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.

    Every time you move between the hierarchy levels, the scale of the vertical axis adjusts automatically.

  7. Put the pointer over the label of the horizontal axis, and note that it change color; it is also link-enabled. You can 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.