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

Load Hierarchy on each level as level 1

I use the Hierarchy functie to create a table like this:

Name1, Name2, Name3, Name4, Name5 etc..

This all works.

How i want each part of the hierarchy also to be available in Name1.

What i could do something like this:

t2:

LOAD Name1, Name2, Name3, Name4, Name5 RESIDENT t1

Concatenate (t2)

Name2 As Name1, Name3 As Name2, .... RESIDENT t1;


Concatenate (t2)

Name3 As Name1, Name4 As Name2, .... RESIDENT t1;


Anyone has a better way to do this?

I need this table as a staging table for a PL


Thanks in advanced

7 Replies
el_aprendiz111
Specialist
Specialist

Hi,

1 Example

hierarchy.png

amien
Specialist
Specialist
Author

@fer fer

i dont quite get it.

my original source has 2 fields NodeID and ParentID (+naming)

Then i do a HIERARCHY load. and it will give me the needed hierarchy with Name1,Name2 etc.. (quite a few levels).

But not all levels have the same depth. Some are 4 deep, others like 7 for example.

Then i need to concatenate Name2 until the end to Name1. So all levels need to shift 1 level up.

I dont see how this fits in your "-SEM" etc solution. can you example how i should transform this above explanation into your example?

el_aprendiz111
Specialist
Specialist

Hi,

send me a sample data.

MarcoWedel

can you elaborate on what you are trying to do with the resulting table?

Did you take a look at the HierarchyBelongsTo prefix as well?

regards

Marco

amien
Specialist
Specialist
Author

I'm trying the get the PL in the proper order. Level 2 needs to show up as Level 1 to. And some Level 3 needs to be shown on level 1 also (with the lower levels aswell).

Yes, i have the HierarchyBelongsTo functions working, but i'm not sure how to get the needed results from that. Because this functions will give me all the possible combination for each level. But then what?

amien
Specialist
Specialist
Author

i added an example in the first post

el_aprendiz111
Specialist
Specialist

Hi,

HIER_LEVL.png

HYERA_LEVEL.gif