Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEALast week's solution can be found here!
This week's challenge was brought to you by no other than the distinguished @Joe_Mako!
A bill of materials or product structure (sometimes bill of material, BOM or associated list) is a list of the raw materials, sub-assemblies, intermediate assemblies, subcomponents, parts and the subcomponents each needed to manufacture an end product.
In the bill of materials, each record is a line item with a Line ID, Level, Part Number, Description, Unit, Quantity, and Parent ID. Your challenge is to calculate the 'Full Quantity' and 'Parent Quantity' of each line item. For example, 1 car has 4 wheels, each wheel has 5 bolt assemblies, and each bolt assembly has 2 washers. For the washer line item, the Full Quantity is 40, and the Parent Quantity is 20.
The ideal solution would work for any number of levels.
Charlie Chaplin on the Assembly Line
@JoeM @Joe_Mako Fun challenge.
Really fun challenge, @Joe_Mako!!
Started to create an Iterative macro, but then remembered techniques from past challenges and decided to do it macro-less. Took a slightly different angle than @patrick_digan
I took Iterative Macro route.
Thank you @Joe_Mako for the challenge.
@estherb47 @patrick_digan Liked your solutions.
My solution! Took the Iterative macro approach, and while it technically worked, I couldn't figure out how to get the iterative results to automatically sort into Line ID order before output... but I was happy enough to get the iterative part working, so it'll do :)
thanks for the challenge @Joe_Mako!
Very similar approach to @gnans19, and @NicoleJohnson and @PhilipMannering but not as slick!
I was going to an iterative macro like the others had done but it seems a bit overkill for the problem at hand, so I went for a more simplistic approach.