Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
stefanmn
Contributor
Contributor

hierarchy

Hi,

i am struggeling with hierarchy function in QV without getting close to my prefered result. I have two tables. One is relating names to IDs the other is relating the IDs with each other. I try to get a hierarchy level tree structure out of this.

Looking forward to some helping input on a script solution.

BR

Stefan

Unbenannt.PNG

Labels (1)
2 Replies
nsetty
Partner - Creator II
Partner - Creator II

Can you try this below

RelTable:

Load * Inline [

ParentID, ID

2001, 3001

4001, 2001

4001, 5001

4001, 6001

5001, 3001

, 4001

];

Left Join(RelTable)

Load * Inline [

ID, Title

2001, B

3001, C

4001, A

5001, D

6001, E

];

HTable:

Hierarchy(ID, ParentID, Title, ParentTitle, Title, PathName, '\', Depth)

load * resident RelTable;

hierarchy.PNG

stefanmn
Contributor
Contributor
Author

Dear Nagesh,

your example is working for the simplified data. My data are not containing statements like you introduced in your example (" , 4001"), defining what is the top level of hierarchy. Any idea how to get over that obstacle?