4 Replies Latest reply: Jul 16, 2013 10:07 AM by Rainer Filoda RSS

    Group by and then assign a particular value

      Hello,

       

      I'm not entirely sure how to best describe this (but see below tables which should hopefully illustrate this) but I am wanting to group data, in the script, by a docketID and then assign a particular code to that particular docketID but not the code N/R. So for CustomerA with a code of R199 I want to group the assigned docket ID by summing the totals of (19,000, 45, 60, 125, 400 and 2000) and then assign the code of R199 to all of this data.

       

      Thanks,


      Ralph

       

       

      Original dataset:

       

      CustomerDateCodeTotalDocketID
      CustomerA16/07/2013R1991900012345
      CustomerA16/07/2013N/R4512345
      CustomerA16/07/2013N/R6012345
      CustomerA16/07/2013N/R12512345
      CustomerA16/07/2013N/R40012345
      CustomerA16/07/2013N/R200012345
      CustomerA16/07/2013R2855000045678
      CustomerA16/07/2013N/R12445678
      CustomerA16/07/2013N/R56045678
      CustomerA16/07/2013N/R200045678

      CustomerB

      16/07/2013R1992500056789
      CustomerB16/07/2013R2853500067890
      CustomerB1707/2013R6701850078901

       

      Required data:

       

      CustomerDateCodeTotalDocketID
      CustomerA16/07/2013R1992163012345
      CustomerA16/07/2013R2855268445678
      CustomerB16/07/2013R1992500056789
      CustomerB16/07/2013R2853500067890
      CustomerB1707/2013R6701850078901