Elements of a dimenison (a column that contains categories) can be structured in a custom hierarchical order. Hierarchy can be established in a dimension by adding a special column "Parent" while preparing a dataset. The parent column provides the structure for all indicators within a dimension. There are two possible types of parent elements:
Parent elements having data (clickable parents)
This case represents a situation when hierarchy level titles have data and should be clickable in a dataset. E.g. raw data has values for some aggregating elements like group of countries.
In the example below, dimension “Member State” will have “COMESA” as a parent or highest level, all other elements should be under the COMESA in terms of order and have lower level of hierarchy as well.
Element COMESA has its “code” or ID - C22. This id should be put in the “Parent” column for each element that falls under COMESA: Burundi, Comoros, etc. Also, “order” of COMESA should equal 1 to place this element first in the dimension.
Note: If all elements has empty parent column, it leads to standard view, when all elements of a dimension have the same highest level of hierarchy and look like a plain list of elements.
It’s possible to add several hierarchy levels. Example below presents hierarchy where there are data for world, world regions, and countries in the regions. Let element world has code – A208, and this code should be set for all world regions as parent, then code of each world region should be set for countries according to particular world region.
Colors on screenshot above are example of how hierarchy will look like. Pay attention to values in column “order”, they should be placed according to the final view and order. Despite World has code A208, its “order” value is set to 1 because World should be placed first in the dimension. In the Dataset Viewer, the dimension with the hierarchy will look as follows:
In the example above, all world regions have the same hierarchy level which is a child of the World. But it’s also possible to have several elements of the highest hierarchy level. To do so, these elemetns should have empty cells in the "Parent" column.
Parent elements not having data (titles)
This cases repersents a situation when either hierarchy level titles do not have data or a user wants to create his or her own titles in dataset for better navigation.
For example, if there are many elements in a dimension one may want to group them into categories. On a screenshot below, there are 8 indicators, colored according to their categories. So, group 1 should contain indicators B1 and B5, group 2.1 – B2, B3, B8, and group 2.2 – B4, B6, B7.
To reproduce this strucuture using hierarchy, first, create new rows for hierarchy titles:
Then, set parent codes as needed using "Parent" column.
In our example, groups don’t have data, so they are not added into data sheets.
The result of uploading the dataset with the hierarchy described above will look as follows in the Dataset Viewer:
Summary:
- Its possible to add hierarchy either when parent elements have data or do not have data. Titles with values will be clickable elements of a dimension while the ones without data will be present just as text.
- Hierarchy can have several levels, and can have any number of elements for each level, even for the highest one.
- Values in the "Order" column of a dimension sheet reflect the actual order of elements in the Dataset Viewer.