1

I have a data as below. I have created column "difference in values" manually, the calculation is value at 8:15 AM - value at 8:00 AM which is 2 in second row and so on for all values of column Tushar and Lohit respectively. How can i do this calculation in Spotfire i believe over and previous function can help but i am unable find anything on this. Please help

Name    Time    Values  Difference in values
Tushar  08:00 AM    2   0
Tushar  08:15 AM    4   2
Tushar  08:30 AM    5   1
Tushar  08:45 AM    6   1
Tushar  09:00 AM    7   1
Lohit   08:00 AM    2   0
Lohit   08:15 AM    4   2
Lohit   08:30 AM    5   1
Lohit   08:45 AM    6   1

1 Answers1

0

This should work

SN([Values] - Max([Values]) over (Intersect(Previous([Time]),[Name])),0)

where Max(..) is just to have an aggregation, since it is only looking at the previous Time row for each value of Name. [so Min would work just as well].

SN(...) is there to set the result to 0 when it is empty (as in the first row of each Name).

Gaia Paolini
  • 1,044
  • 1
  • 5
  • 4