Coming soon: We’re working on a brand new, revamped Community experience. Want to receive updates? Sign up now!

0 votes
Trying to find a simple way to calculate the difference in datetime between rows in a column.  Number of rows in dataset very large therefore pivot will not work.  Where deltadatetime of current row = datetime of next row - datetime of current row by unique ID

{ID]  [DateTime]   [Code]  [DeltaDateTime]

1 Answer

0 votes

Assuming your IDs are unique in the dataset

You can use a window recipe with the following settings

- order columns: ID

- window frame: limit the number of preceeding (or) following rows = 1

- aggregation -> lag (or lead) diff ( you can choose in seconds up to years) or use a custom aggregation

1,337 questions
1,362 answers
11,912 users

©Dataiku 2012-2018 - Privacy Policy