AnsweredAssumed Answered

How to calculate difference between time fields over a table

Question asked by anakaine on Jul 31, 2017
Latest reply on Jul 31, 2017 by bixb0012

I'm hoping someone might be able to help me here:

 

I am looking to calculate the difference between the timestamps in the current row of a table, and the preceding row. Then, if the difference exceeds a set amount, increment the number in the Journey_Number column by 1. At the moment I am dumping all my data to excel to do this, but it's very inefficient. Example data is below.

 

At the moment I've worked out a model that can draw in related files, spit each out as a shapefile, then merge the shapefiles, reduce identical values, and sort by the timestamp field using regular toolbox items. In theory the data should be sorted at this point so that it's all sequential. This function, however, requires something more specific such as a python script - and I'm in over my head. 

 

Any help is appreciated

 

 

(Given information)(Calculated Information)(Calculated Information)
TimestampSeconds_from_prior_line_to_this_lineJourney_Number
2015-07-13T23:49:09Z1
2015-07-13T23:49:17Z81
2015-07-13T23:49:23Z61
2015-07-13T23:49:24Z11
2015-07-13T23:49:32Z81
2015-07-13T23:49:44Z121
2015-07-13T23:49:51Z71
2015-07-13T23:49:59Z81
2015-07-17T06:04:27Z8682
2015-07-17T06:05:02Z352
2015-07-17T06:05:05Z32

Outcomes