Creating new dimension hierarchies
You may find it useful to define a hierarchy of dimensions, to enable visuals with variable levels of granularity over the same range of data.
The following steps demonstrate how to define such a hierarchy on the dataset
World Life Expectancy [data source
samples.world_life_expectancy]. We will use the dimensions
un_region, un_subregion, and country to define a dimensional
hierarchy called Region.
On the main navigation bar, click Data.
The Data view appears.
- Open on the Datasets tab.
- In the left navigation menu, click Samples.
In the Datasets area, select World Life
In the Dataset Detail menu, select
In the Fields interface, select Edit
In the editable Fields interface, under
Dimensions, find the field
Click Down icon on the
un_regionline, and select Create Hierarchy.
In the Create Hierarchy modal window, enter the values for
Hierarchy Name and Hierarchy Comment, and
We named our hierarchy Region, and described it as Geographical Granularity.
Note that Measures now contain a hierarchy
Region, denoted by the Hierarchy icon. The
hierarchy contains a single element,
To add more levels to the hierarchy, simply click and drag the relevant dimensions or
measures to the newly created hierarchy. Be sure to arrange them in order of scale, from
largest to smallest.
un_region, we added
un_subregion, we added
Note that the hierarchy Region appears alongside the dimensions obtained directly from the data table.
Defined dimension hierarchies, such as Region that we created here, can be used just as any other dimension field of the dataset.