18 Replies Latest reply: Jan 3, 2017 6:43 AM by Adam Davies RSS

    Executing of values till leaf node.

    ahmar ansari

      Dear Experts,

       

      This are my input tables

      Input Table:

      StemLeaf
      AA1
      BB1
      CC1
      DD1
      B1B2
      C1C2
      D1D2
      C2C3
      D2D3

       

      I have given to analyse for Stem (A,B,C,D)

       

      Step 1- I need to find Leaf value of Stem (A,B,C,D)  i.e (A1,B1,C1,D1)

      Step 2- Find these values in Stem & corresponding leaf values i.e (B2,C2,D2)

      Note- If corresponding value is not found  in Step 2 like for A1 then its null

      Above steps should be performed till all leaf are found in loop with first iteration as Level2 then Level 3 & so on.

       

      Data Table:

      LeafValue
      A110
      B120
      C130
      D140
      B250
      C260
      D270
      C380
      D390

       

      The Result should be look like this, so that we will be able to make a drill group with all levels & get corresponding values as shown:

        Output :

      Level0Level1ValueLevel2ValueLevel3Value
      AA110----
      BB1-B250--
      CC1-C2-C380
      DD1-D2-D390

       

      'I have tried using left join to make Level but the logic failed at Level 2.

      Also I m not able to retain null values as in above Note'


      Thanks & Regards

      Ahmar