Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hello,
I have in a dataTable, the history of location and status for a vehicle:
When it is moving, i have a record with timestamp, location and eventType=Drive.
When the vehicle stops i have a record with timestamp, location and eventType=Stop.
It is not obvious to get stats from such data, so can someone help to answer the following ?
I need to extract from this:
* % of time vehicle was driving vs stopped
* get a graph with average speed when vehicule was not stopped
* get a graph like this one to display for each vehicle when he was used, and display in blue/green/yellow based on average seed.
* Display a graph that display for a specific day
Solved! Go to Solution.
Hi Laurent
I think you need to do a bit more processing of your data. When your Stop event fires, you need to find the previous Drive event and calculate the time between the two events and store that in a cumulative drive-time property. Likewise, for Drive events you need to find out the time between now and the previous Stop event, store this in a cumulative stop-time property - depending on your needs, you may need to filter out some of these or you'll be including the time the vehicle is parked. If you're recording this on a daily basis use a scheduled event to reset the cumulative properties once a day. You can always log these two properties so you can show activity on a chart later.
% time driving vs % time stopped is now simple math using the two properties.
Average Speed, assuming you're logging this on a regular basis, then at each stop event, you can work this out from (sum of speed readings since drive started) / number of readings. If you're using a valuestream then this is harder to do as you will only get readings when the value changes. If you're recording GPS position, you may be able to calculate average speed based on the route information.
For the graph have two number properties, isDriving and isStopped. Set them to 10 when true, 0 when false. Log the properties. Display using a bar chart.
Hope this helps
Regards
Ian
I think you can 'somewhat' build that with the Range Chart
Hi Laurent
I think you need to do a bit more processing of your data. When your Stop event fires, you need to find the previous Drive event and calculate the time between the two events and store that in a cumulative drive-time property. Likewise, for Drive events you need to find out the time between now and the previous Stop event, store this in a cumulative stop-time property - depending on your needs, you may need to filter out some of these or you'll be including the time the vehicle is parked. If you're recording this on a daily basis use a scheduled event to reset the cumulative properties once a day. You can always log these two properties so you can show activity on a chart later.
% time driving vs % time stopped is now simple math using the two properties.
Average Speed, assuming you're logging this on a regular basis, then at each stop event, you can work this out from (sum of speed readings since drive started) / number of readings. If you're using a valuestream then this is harder to do as you will only get readings when the value changes. If you're recording GPS position, you may be able to calculate average speed based on the route information.
For the graph have two number properties, isDriving and isStopped. Set them to 10 when true, 0 when false. Log the properties. Display using a bar chart.
Hope this helps
Regards
Ian
Thanks a lot Ian, I got a whole bunch of useful insights from this comment!