Trying to see if I can get some help on this. I have a 3 columns of data. A Parent that begins with FG_ a Child and Qty needed of that child to make the parent part. A Child could be a parent part in a different row and so on. I need to calculate the required Child Qty to FG_ parent, taking into account that a Child in one row could be a Parent in a different row. Example, the FG_Bike needs 116 bearing, since each link requires 2 bearings and 58 links are required to make one chain and one chain is need for FG_Bike.
Current Structure
Parent...............Child...........Qty
FG_Bike..............Frame..........1
Frame................Tubes..........7
FG_Bike..............Brakes.........2
Brakes................Brake Pad....2
FG_Bike..............Chain......... 1
Chain ................Links..........58
Links..................Bearing.........2
OUTPUT -------
Parent---------New Child---Qty at Lowest level
FG_Bike.............Frame...........1
FG_Bike.............Brakes...........2
FG_Bike.............Brake pad......4
FG_Bike.............Tubes...........7
FG_Bike..............Chain..........1
FG_Bike..............Links...........58
FG_Bike..............Bearings.......116
Current Structure
Parent...............Child...........Qty
FG_Bike..............Frame..........1
Frame................Tubes..........7
FG_Bike..............Brakes.........2
Brakes................Brake Pad....2
FG_Bike..............Chain......... 1
Chain ................Links..........58
Links..................Bearing.........2
OUTPUT -------
Parent---------New Child---Qty at Lowest level
FG_Bike.............Frame...........1
FG_Bike.............Brakes...........2
FG_Bike.............Brake pad......4
FG_Bike.............Tubes...........7
FG_Bike..............Chain..........1
FG_Bike..............Links...........58
FG_Bike..............Bearings.......116