Skip to content
Advertisement

BOM Explosion with Blanks

I have a simple BOM table that contains a parent and a child column. Every row contains values. There are no blanks. To bring that table into a BI-Tool I need to add blank values for the parents, like here shown: enter image description here

As you can see, if an EntityKay has no parent key, then there should be a blank value. How would you do that?

Example:

Current State:

Needed Result:

Advertisement

Answer

This query provides the missing keys, i.e. the parents, that are no childs are selected with the parent null

You must add those records (with an INSERT) to your table and probably update additionaly the description.

Result

To get the extended data without modifying the table use an UNION ALL of the ofiginal table with the query providing the missing part.

You may add also the names for the new rows using the DECODE as show below in the example

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement