6 Replies Latest reply: Nov 28, 2013 7:48 AM by alvinford ford RSS

    Derive New Field

    alvinford ford

      Dear All,

       

      I have the below table.

       

      IDIDLOCFlagRange FromRange To
      B1B011100250
      B2B01 2080
      B5B01 120240
      B6B021200300
      B8B02 210280
      B9B0320100
      B11B03                         1250350
      B12B03 150300

       

      The logic i have to achieve is as follows:

       

      I have to compare the "Range From" and "Range To" of same group  IDLOC with the IDLOC with Flag

       

      For Ex1: The ID B2 has to be compared with ID B1 "Range From" and "Range To". If the "Range From" and "Range To" of ID B2 does not fall in between the "Range From" and "Range To" of ID B1 then Mark it as 1  else 0.

       

      In the Same manner the B5 "Range From" and "Range To" has to be compared with B1 "Range From" and "Range To" and mark the Flag

       

       

      Ex2: The ID B9 and B12 has to be compared with B11  "Range From" and "Range To" and mark the flag.

       

      Finally need to achieve the New Field as Below

       

      IDIDLOCFlagRange FromRange ToNew Field
      B1B011100250
      B2B01 20801
      B5B01 1202400
      B6B021200300
      B8B02 2102800
      B9B03 201001
      B11B03                         1250350
      B12B03 1503000

       

      Thanks in Advance...

       

      Regards,

      Alvin.