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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Mattthei
Contributor
Contributor

Hierarchy where node is parent

Hi,

I have a datatabel and script which is pretty straight forward:

 

Hierarchy(Material,HeadMaterial,MaterialName)
Load
Material,
HeadMaterial,
MaterialName
from Table1;

 

From this I created an hierarchy, no problem. But the challange here:

In every nod, the nod itself contains more nodes and the node is found in the Parent field, with no connection to the "original" parent.  So this is the hierarchy I get (Notice material 3 is found both as node and as parent)

HeadMaterialSubmat 1Submat 2 Submat 3Submat 4
1234 
35679
71015  

This is what I need, you see that HeadMaterial 3 an is found under HeadMaterial 1 but lacks the submaterials included. Same for material 7 but under material 3 instead. Note that material 3 and 7 can have diffrent parents with no restriction to how many.

HeadMaterialSubmat 1Submat 2 Submat 3Submat 4Submat 5Submat 6Submat 7
1234    
   5679 
      1015

Any suggestions on how the create an single hieracy including ALL submaterials?


Thanks in advance!

Labels (1)
1 Reply
AbhijitBansode
Specialist
Specialist

I Understand you have table with Adjacent nodes. Please check if HierarchyBelongsTo can help.

https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes...

However if still facing issue, post sample data in the thread.

 

Qlikgards,

AB