1) First Data frame is created with the values shown as above
2) Take Parent id of first row from the bottom and compare that value with the Child ID in the the second data frame . If an entry is found under child node , We need to extract that Child Node ID , Type and Level and add it to the first data frame at the top of the row .
In the above example , 100336 Parent id from the first data frame is selected and compared in the second data frame . Since the value is found under the child node , I have extracted that and put it into above 3 rows . Color highlighted above
3) One we make an entry with that combination ,we need to add the value from Data frame1 to final table with that combination . We need to traverse from bottom to top with the same appraoch
4) To Calculate Value 1 , Formual is , Value of Child ID * Value 1 of Parent ID / SUM( Value of All Parent ID ) . I. have given example above