1 Reply Latest reply: Apr 23, 2014 11:52 AM by Manish Kachhia RSS

    Merging Rows

      Hai i had two source fil. One is Excel and another is QVD. I had the values as follows.

       

      Excel:                    

      CategoryValue
      A-B      6
      C       4

       

      QVD:

       

      CategoryValue
      A2
      B5
      C5

       

       

      My Output should be as follows:

       

      CategoryExcel ValueQVD Value
      A-B67
      C45

       

       

      Need to make QVDs A and B value as A-B value and i need to get the above result. Could anyone answer me pls?

        • Re: Merging Rows
          Manish Kachhia

          Use below script

          ===============

          Excel:

          Load

            Category,

            Value as Value1

          Inline

          [

            Category, Value

            A-B, 6

            C, 4

          ];

           

           

          QVD:

          Load

            If(Category='A','A-B',IF(Category='B','A-B',Category)) as Category,

            Value as Value2

          Inline

          [

            Category, Value

            A, 2

            B, 5

            C, 5

          ];

          ==========================

          Now create a straight Table

          Dimension = Category

          Expressions

          1) SUM(Value1)

          2) SUM(Value2)