2 Replies Latest reply: Feb 13, 2015 10:51 AM by Benjamin DEMOUSTIER RSS

    Peek vs Previous

    Benjamin DEMOUSTIER

      Hi,

       

      Do anybody have an idea to solve this very simple problem:

      I have loaded a table like this:

       

       

      INV

      PO

      key

      a

      1

      X

      b

      1

      X

      c

       

      X

      d

       

      X

      e

      2

      Y

      f

       

      Y

      g3Z
      hZ
      i4W
      jW
      kW
      l5T
      I5T

       

      For each value of 'key' I can have 0 to n value of INV and/or PO

       

      I'd like to fill in missing value of PO with PO value having same key

       

      result should be:

       

      INV

      PO

      key

      PO2

      a

      1

      X

      1

      b

      1

      X

      1

      c

       

      X

      1

      d

       

      X

      1

      e

      2

      Y

      2

      f

       

      Y

      2
      g3Z3
      hZ3
      i4W4
      jW4
      kW4
      l5T5
      I5T5

       

      I tried with if(key=previous(key) and isnull(PO),previous(PO),PO) as PO2 but it works only for one line....

       

      Any idea ?

       

      Kind regards