How do I first bin by values in two columns and then calculate cumulative sum of each bin?

My initial data set consists of column Timestamp in 1 minute increments, a Row ID column, and a Vibration X column with real values.  I then filter this table to show only rows where Vibration X values are > 30.  Then from this filtered view, I bring in the Vibration X value from the previous row as column Previous Vib X {expression : First(FirstValidBefore(If([Vibration X]>30,[Vibration X],0))) OVER (Previous([Row ID])) }.  My desired output column Consecutive is what I would like to achieve.  It calculates the number of consecutive rows where both Vibration X and Previous Vib X are > 30 (please see attached - capture.jpg).

Attachments

AttachmentSize
Image icon capture.jpg104.11 KB

(1) Answer

Login