How to determine the duration of an event, when row spacing is not even / linear in time.

Hi,

I am trying to work out how to display how long something has happened for when the time series in my rows of data are not necessarily the same time step.  This means I cannot assume, say 1 second or one minute, and just rely on row count.

Below is histogram example

 

Sample Data - whilst mostly close to a minute apart, it is not always this way:

DateTime Asset Ignition Speed RPM Fuel Rate hdn_NozzleDown Nozzle Down Beacons
18/10/2018 00:00:00 208253 OFF 0MPH     FALSE    
18/10/2018 00:30:00 208253 OFF 0MPH     FALSE    
18/10/2018 01:00:00 208253 OFF 0MPH     FALSE    
18/10/2018 01:30:00 208253 OFF 0MPH     FALSE    
18/10/2018 02:00:00 208253 OFF 0MPH     FALSE    
18/10/2018 02:30:00 208253 OFF 0MPH     FALSE    
18/10/2018 03:00:00 208253 OFF 0MPH     FALSE    
18/10/2018 03:30:00 208253 OFF 0MPH     FALSE    
18/10/2018 04:00:00 208253 OFF 0MPH     FALSE    
18/10/2018 04:30:00 208253 OFF 0MPH     FALSE    
18/10/2018 05:00:00 208253 OFF 0MPH     FALSE    
18/10/2018 05:03:01 208253 ON 0MPH     FALSE    
18/10/2018 05:03:07 208253 ON 0MPH 0 0 FALSE    
18/10/2018 05:04:09 208253 ON 1MPH 0 0 FALSE    
18/10/2018 05:05:11 208253 ON 12MPH 0 0 FALSE    
18/10/2018 05:06:11 208253 ON 33MPH 0 0 FALSE    
18/10/2018 05:07:11 208253 ON 35MPH 0 0 FALSE    
18/10/2018 05:08:11 208253 ON 37MPH 0 0 FALSE    
18/10/2018 05:09:11 208253 ON 35MPH 1502 3.3 TRUE ON ON
18/10/2018 05:10:11 208253 ON 11MPH 1499 9.7 TRUE ON ON
18/10/2018 05:11:11 208253 ON 9MPH 1499 9.25 TRUE ON ON
18/10/2018 05:12:07 208253 ON 8MPH 1499 8.9 TRUE ON ON
18/10/2018 05:13:11 208253 ON 7MPH 1500 8.35 TRUE ON ON
18/10/2018 05:14:11 208253 ON 11MPH 1500 8.5 TRUE ON ON
18/10/2018 05:15:09 208253 ON 10MPH 1500 8.25 TRUE ON ON
18/10/2018 05:16:11 208253 ON 10MPH 1499 8.2 TRUE ON ON

Thank you for your help.

 

Gareth

1 Comment

Don't you only need to know 2 timestamps - event.start and event.end?

Duration_in_days=DateDiff('minute', [event.start], [event.end])

REF: Calculations of time differences

Don Johnson - Aug 05, 2019 - 11:04am
+ Add a Comment
Login