Running Time Difference/Deltas Time

For table (X:aabb`b; Time: 10:30:00.123 11:35:00.123 09:30:00.123 10:30:12.123 13:30:00.123)

How can I calculate a new table that has the differences by X?

result:  (Y:ab`b;Diff: 05:00:00 01:00:12.001 03:00:00.002)

thx.

Hi Ben,


Is this a step in the right direction?


value select Y:1_X, Diff:1_ deltas Time by X from t


deltas gives the differences

1_ gets rid of the startup value

value gets rid of the table key


Will

This might be what you are looking for:

Given:

a: ([]X:aabbb; Time: 10:30:00.123 11:35:00.123 09:30:00.123 10:30:12.123 13:30:00.123)`

Result:

ungroup select Diff:1_ deltas Time by X from a

As JW Buitenhuis mentioned, deltas gives you difference between consecutive rows and you can group the response using ‘by’. 1_ removes the first entry if you don’t want that per group. This gives you back a dictionary. _Ungroup…_well, ungroups the data and returns a table in the format you asked for.