Skip to content
Advertisement

How to get time difference Duration totals grouped by Name and when Value changes in certain way?

I’m looking for the Sum of time value differences between rows where Value was initially 1 and is now 0, grouped by Name.

Example data for a single Name, but there are many different Names in the real data.

This data should return 11 minutes for Row 9–>7 transition and 5 minutes for Row 4–>2 transition; totaling 16 minutes for this Name.

I’m not sure how to accomplish this when it’s not guaranteed that the next row has the correct Value change – sometimes it will be several or many rows later.

Advertisement

Answer

Update:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement