I need to calculate the difference between non-consecutive records of a variable, grouped by another. That is, I want to take the last value of the variable in a run and subtract it from the first value in the next run (if there is any).I need to calculate the difference between non-