### Title

Scripting down a tree

### Post

Good Morning:

I am at a loss having tried for days to script an action that would take a part code and go down the BOM tree until it reaches the final child item while multiplying the quantities along the way. So a simple example:

If Part A has 2 components B and C, and requires 2 of B and 3 of C

Part Component Qty

A B 2

A C 3

Then my output needs to have 2 lines multiplying the # of A items to be made by the amount of B items and C items. If B or C have children of their own, the script has to continue down the tree multiplying along the way.

I've tried For loops comparing Part numbers to Child numbers, then I've tried Perform Finds instead of looping. I get stuck when I need to recur and save variables for the multiplication. I am attaching my Recipe_Ingredient table as an example.

Thanks

Most often, a recursive script is needed to traverse a Tree data structure. See this demo of a recursive BOM: https://dl.dropboxusercontent.com/u/78737945/RecursiveBOMDemo.fmp12