Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

BOM Explosion using Hierarchy & HierarchyBelongsTo

I'm attempting to perform a bill of materials explosion in QV using Hierarchy & HierarchyBelongsTo. My data looks something like this:

ParentChildTypeQty
ABMake2
AEBuy1
AFBuy1
BCMake2
CDBuy2
DGMake1
GHBuy1


My goal it to get a flat table depicting the total BOM structure for several hundred thousand parts (perhaps millions of parts). The resulting table would look something like this:

ParentChildTypeQtyLevel
AAMake10
ABMake21
ACMake42
ADBuy83
AEBuy11
AFBuy11
BBMake10
BCMake21
BDBuy42
DDMake10
DGMake11
DHBuy12
GGMake10
GHBuy11


Hierarchy seems to get me close, but, I'm missing top level parent ID and am not sure how to calculate the expanded quantities. Any ideas?

12 Replies
hic
Former Employee
Former Employee

I do not understand where you think it is wrong. The pivot table in my example shows the same numbers as in the original data - which I assume is what it should. E.g. 'A' has 10 units and 'B' has 8. Do you have an example of where the result is wrong?

Not applicable
Author

OK i will try to test your example by adding some fake invoice lines to the data model. But only after the weekend, so thanks for helping me so far and have a good weekend yourself!

Not applicable
Author

I hope you are still active Henric...

Do I need to insert just a single root node or one for every distinct parent? How would the script look to do either?