Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculate difference between consecutive rows filtered by SELECT DISTINCT

I need to calculate the difference between values in consecutive rows and display the value in the 2nd of each pair of rows, apparently without the help of an index. Specifically, I created a calcul...
  • amitchandak's avatar
    4 years ago

    Anonymous , Try a new column like

     

    New column =
    var _max = maxx(filter(Table, [PERMIT_ID] =earlier([PERMIT_ID]) && [ACTION DATE] <earlier([ACTION DATE])) , [ACTION DATE])
    return
    [WORKDAYS SINCE FILED] - maxx(filter(Table, [PERMIT_ID] =earlier([PERMIT_ID]) && [ACTION DATE] = _max) , [WORKDAYS SINCE FILED])