How to find parts only on certain BOMs?

I’m tasked with finding parts that only exists on a handful of BOMs. That is we need a list of parts that only exist on BOM abc, xyz, or def. My first thought is I can’t do this in a BAQ I’d need to use APIs to iterate over the BOMs and run a where used on every part on the BOMs… Any suggestions if it’s possible to develop a BAQ to do this(I assume it would be faster/cheaper to develop a BAQ than software to do this)?

you can do a recursive BAQ… if you search this forum board for recursive baq or exploded BOM, I believe that there have been some examples posted.

1 Like

What I do when exploding multiple BOMs, is set an unused attribute field for parts ABC, XYZ, and DEF to some value. Then in the anchor of the recusive BAQ just use the part table filtered for whatever that value is. That will mass explode all BOMs for ABC, XYZ, and DEF

Then you can group those results by super parent and child part in a sub query, then at the top level do a string_agg where you group by child part, and a aggregate the super parents into a string.

You should then be able to make a subquery criteria to filter for the child parts that have a super parent string that contains ABC and XYZ and DEF

1 Like

In case this helps anyone in the future, I ended up creating two subqueries. One returned all parts from the BOMs in question and included a calculated field of how many active approved BOMs these parts are on. I then created a second subquery that returned all parts and counted how many active approved BOMs these parts are on. At the top level I used a left join such that we only have the parts on the BOMs of interest and created another calculated field to find the delta the counts from each subquery. If the delta is 0 the part only resides on the BOM of interest, otherwise the parts also exists on other BOMs…