Skip to main content

Hello,

 

i have a question for a scanner. the scanner drive through our city. the scannner makes a couple of rounds per day. But i have many record with a timestamp. between the rounds there is a time diffrent say 1 hour or more. 

how can i crerate a round number that the scanner makes.

for example the scanner start at 7.00 en ends at 10.00  (thats round 1) and then starts at 13.00 and ends at 16.00. (thats round 2) the next day is somewhat the same but the count must go on.

 

Beste Regards Robert

Not sure what you have. Do you have individual records with points and datetime stamps? If that is the case, you can sort the rows on datetime and then calculate the time difference between each record. If the time difference is greater then a treshold value, say 60 minutes, you can then start a new group number.

When I need this I first create it in Excel with formula’s. When I have what I want, I recreate this with an AttributeCreator with Adjacent Feature Attributes enabled and conditional values. If you need assistance / a sample give a shout.


Not sure what you have. Do you have individual records with points and datetime stamps? If that is the case, you can sort the rows on datetime and then calculate the time difference between each record. If the time difference is greater then a treshold value, say 60 minutes, you can then start a new group number.

When I need this I first create it in Excel with formula’s. When I have what I want, I recreate this with an AttributeCreator with Adjacent Feature Attributes enabled and conditional values. If you need assistance / a sample give a shout.

Further to this, i’d look to convert your datetimestamps to epoch. This is measured is seconds and therefore makes it very easy to sort and find groups (you can turn them into ‘spatial’ points and see them grouped)


Thank you all for the answers, but i am still strugling.

In the image you see at record 271 that the timediffrent is 2 hours.but how do ik make the records before 271 as segment 1 and on 271 and above segment 2?

 


First groupNumber = 1.

If DateTime difference is less then 60 minutes, groupNumber = same as previous groupNumber.

Else previous groupNumber + 1.


First groupNumber = 1.

If DateTime difference is less then 60 minutes, groupNumber = same as previous groupNumber.

Else previous groupNumber + 1.

Attached sample demonstrating this.

 


@nielsgerrits 

this example is great. thank you very much.🤗

 


Cheers :)


Reply