Forum Discussion

vipett's avatar
vipett
Icon for Helper III rankHelper III
3 years ago

Inner join two created tables to create tree structure

I would like to build a "tree structure" for BOMs in a report.

 

Current method:

 

I import all BOMS in a table such as this:

ArticleQuantityComponent
A1D
A2B
A1T
B1X
B1Y
B1Z
D3G
D2H

 

Then I create a support table to identify which Components are "assemblies" which are also broken down, in the list above that would be B and D.

 

Based on my support table, I create one table called Level 1 where the top level articles are shown: 

ArticleQuantityComponent
A1D
A2B
A1T
B1X
B1Y
B1Z
D3G
D2H

 

And a different table, Level 2 where the assemblies are shown

ArticleQuantityComponent
B1X
B1Y
B1Z
D3G
D2H

 

Then I create a realation in between the Component in Level 1 and Article in Level 2. this is the put in a visual and when I also show items with no data, I get a tree structure. 

 

However, I was thinking about doing this as a calculated table instead, innerjoin Level 1 and Level 2, but since I need first to do my check step, I can't take it straight from my database, thus I can't use PowerQuery for this..

 

What would be the best way to solve this?

No RepliesBe the first to reply