Skip to main content Skip to complementary content

Defining your hierarchies

Next, you will add a hierarchy to your logical model. Hierarchies is an optional business logic feature. It defines drill-down relationships between groups.

When you enable business logic, some hierarchies may be automatically created by Qlik Sense from your data model. If you navigate to Hierarchies, you can see that business logic has created two hierarchies.

Hierarchies in the logical model

Default hierarchies in the logical model. There is one for Categories and Products and one for Supplies and Products

Hierarchies indicate groups that can be used to break each other down in analysis. For example, the two hierarchies created by Qlik Sense correctly identify two drill-down relationships in our logical model:

  • The data in the Category fields can be broken down into the data in the Products fields.

  • The data in the Suppliers fields can be broken down into the data in the Products fields.

If you navigate to Sheet, click Insight Advisor, and select CategoryName, Insight Advisor includes a tree map that breaks down CategoryName by ProductName.

Category and products breakdown

Insight Advisor results. A breakdown chart for CategoryName and ProductName is selected.
Tip noteHierarchies do not enable drill-down selections in the generated charts. That requires drill-down dimension master items. For example, if you want map charts that drill-down from to cities after a country is selected, you need to create a corresponding drill-down dimension master item.

Why define hierarchies?

Hierarchies enable you to define a drill-down relationship between groups in your logical model. This helps Insight Advisor creates analyses that break down your data, such as tree maps. Hierarchies also ensure that the preferred groups are used together for drill-down analysis.

In your data model, there is a geographic hierarchy between the data for countries and the data for cities. If you navigate to Sheet and generate charts for the field Country from Insight Advisor, none of the generated results use the field City. We can solve this by adding a new hierarchy to our logical model.

Defining a hierarchy for SalesCountry and SalesCity.

Do the following:

  1. Click Create hierarchy.

  2. For Name, enter Country-City.

  3. Select SalesCountry from Available groups and click >.

  4. Select SalesCity from Available groups and click >.

  5. Click Create.

Results

Navigate to Sheet and click Discover. From the assets panel, select Country. You now have results that reflect the City-Country hierarchy, including a tree map that shows sum(Sales) by Country and City.

New Insight Advisor results for Country

Insight Advisor results for selecting Country. There is a breakdown chart selected for Sum of Sales by Country and City

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!