7 Replies Latest reply: Sep 18, 2014 10:45 AM by Aidan O Reilly RSS

    Previous()

    Aidan O Reilly

      I have a piece of script that looks at the values of a table, these values are completely random and have no set sequecne.

       

      For example

       

       

      Col A          Col B     Line_Number

      45456464     8               1

      45456464     45              2

      45456464     21              3

      102154          5               1

      102154          3               2

      324549          8               2

      7878454         9               1

      7878454         2               2

       

      So the line number works fine when there is multiple occurances it resets to one which is great, however if you look at Col A value 324549  the line_number goes to 2.

       

      How can I get the Line_number to reset to 1 in this instance while ensuring all other line_numbers are calculated as per above.

      if(Previous(col_A)=col_A,numsum(peek('Line_Number'),1),1) As Line_Number

       

      Thanks,

      Aidan