7 Replies Latest reply: Oct 17, 2014 4:04 PM by Leonardo Marenco RSS

    How can I compute only the first occurrence of field value?

      Hello QV community,

       

      I'd be grateful if someone could help me with the following issue.

       

      I have the following source file

       

      ID_1ID_2VALUE_1VALUE_2
      AAA111500500
      AAA222500500
      BBB333600600
      BBB444600600

       

      I need to compute only the first occurrence of ID_1 during LOAD

       

      So, I need to perform the operation only the first time ID_1=AAA.

       

      Same thing for ID_1=BBB

       

      ID_1ID_2VALUE_1VALUE_2[VALUE_1+VALUE_2]
      AAA1115005001000
      AAA2225005000
      BBB3336006001200
      BBB4446006000

       

      LOAD DISTINCT ID_1 does not work in this situation, Is there any other way I can solve this?

       

      Regards,

      Leonardo