6 Replies Latest reply: Oct 31, 2013 5:02 AM by Jairo Martín Miguel RSS

    Select previous value of record if record is empty

    Peter Raijmakers

      Hello

       

      please look at the table:

      IDData
      1A
      2A
      3
      4B
      5
      6B
      7
      8

       

      This is a dataset with missing values. and I would like to achieve in the script that if the value is empty it automatically fills in the previous value.

      So for ID 3, Data should be A (according to ID 2)

           for ID 5, Data should be B (according to ID 4)

           for ID 7, Data should be B (according to ID 6)

      and for ID 8, Data should be B (according to automatically generated ID 7 or ID 6?)

       

      Is this possible to generate in the script? (maybe previous() or peek() statement?)

       

      Thanks