Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
df_qlik
Contributor
Contributor

BOM - Hierarchy

Dear all,

currently I'm trying to display multidimensional BOM's in Qlik Sense. I already read every community post. but unfortunately it did not help me. 
In my original BOM table there is the ParentID, ChildID, ParentMaterialNo, ChildMaterialNo, ParentDescription,  ChildDescription and Quantity. What is missing is the field 'Level' or 'Depth' or something like that. At the moment I'm just able to display a one-dimensional BOM. What I need is at least a two-dimensional BOM and in the best case all the dimensions. 
The result table should look like that:

Level | ParentMaterialNo | ParentDescription | ChildMaterialNo | ChildDescription | Quantity

I would be very grateful for your help!

Labels (1)
2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

I can see two possible ways to solve this problem:

1. You can "flatten" the BOM by loading a pre-defined number of levels into a single table, with separate fields for each level's material, quantity, etc... 

2. You can load the hierarchical data into a hierarchical data structure, using keywords "Hierarchy" and "HierarchyBelongsTo"

See Qlik Sense Help for these topics:

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

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

Cheers,

df_qlik
Contributor
Contributor
Author

Hi Oleg,

thank you for replying. Actually I tried to use both functions "Hierarchy" and "HierarchyBelongsTo", but did not get the desired result.

That's what I tried:

BOM_Hierarchy:
Hierarchy(ChildID, ParentID, NodeName, 'ParentPath','/' ,Depth)
LOAD
  ParentID,
  ChildID,
  ParentMaterialNo, 
  ChildMaterialNo, 
  ParentDescription, 
  ChildDescription,
  ChildDescription as NodeName,
  Quantity
FROM [lib://QVD/BOM.qvd]

Do you have an advice? With the script above I can see the Depth, but I still can not display more than two levels (Parent and the child directly below).

Thank you in advance!

Best regards, Till