Skip to main content
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

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?