Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

why use Hierarchy in Qliksense

Hi,

where the advantage of using the Hierarchy function in the script if we can create a table with several columns with hierarchy and dimensions with drill-down ?

It will be for a subject of performance?

"Hierarchy (NodeID, ParentNodeID, Title, 'Manager') LOAD NodeID, ParentNodeID, Title FROM 'lib://data/hierarchy.txt' (txt, codepage is 1252, embedded labels, delimiter is ',', msq);"

5 Replies
Anonymous
Not applicable
Author

In most cases, you don't need Hierarchy function to build hierarchy.  For example, Year-Month-Date.
But there could be reasons for using it.  Imaging a table that has EmployeeID and ManagerID (for each Employee except the top manager), and the number of levels is not fixed.  In this case the Hierarchy function can help.

Anonymous
Not applicable
Author

i used this example :

   

NodeIDParentIDNodeName
1General Manager A
2General Manager B
111Region Manager A
11111Manager 1
11211Manager 2
1111111Consultant AA1
1112111Consultant AA2
1121112Consultant AA3
1122112Consultant AA4

used in hierarchy.

It is not the same as having a table of this structure ?

   

Level1Level2Level3Level4
General Manager ARegion Manager AManager 1Consultant AA1
General Manager ARegion Manager AManager 1Consultant AA2
General Manager ARegion Manager AManager 2Consultant AA3
General Manager ARegion Manager AManager 2Consultant AA4
General Manager B
Gysbert_Wassenaar

See these blog posts:


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Ricardo,

It is a good example.  The first part you show is a data source, and the second part is a result.  You can build this result from the data source with or without hierarchy function.  What is better in every particular case, it depends or the specifics.  For example, in you case, you can do this without hierarchy if the number of levels is always four or less.

lakshmikandh
Specialist II
Specialist II

In case of Parent-Child Hierarchy without fixed number of levels formation this will be helpful


Thanks  gwassenaar‌ , Michael for the info.