Forum Discussion
Castillo3CS
1 year agoFrequent Visitor
Calculating time between rows
Hi Team, We're having trouble calculating time elapsed for vehicles that are idling. Sensor data for each vehicle is being sent and we need to know how much time a vehicle (bus_id) has spent in i...
Castillo3CS
1 year agoFrequent Visitor
Thanks for the promt reply. First time poster so I really appreciate the help.
Attached data and expected results. Hopefully I got it right this time.
| ID | bus_id | sensor_value | date1 | time1 | Date | Expected |
| 14618 | Bus_002 | 699.75 | 9/25/2024 | 2:29:27 PM | 9/25/2024 2:29:27 PM | 0 |
| 14619 | Bus_002 | 700.25 | 9/25/2024 | 2:29:28 PM | 9/25/2024 2:29:28 PM | 1 |
| 14620 | Bus_002 | 701 | 9/25/2024 | 2:29:28 PM | 9/25/2024 2:29:28 PM | 0 |
| 14621 | Bus_002 | 699.875 | 9/25/2024 | 2:29:28 PM | 9/25/2024 2:29:28 PM | 1 |
| 14622 | Bus_002 | 699.25 | 9/25/2024 | 2:29:32 PM | 9/25/2024 2:29:32 PM | 4 |
| 14634 | Bus_002 | 700.125 | 9/25/2024 | 2:29:36 PM | 9/25/2024 2:29:36 PM | 4 |
| 14635 | Bus_002 | 699.875 | 9/25/2024 | 2:29:36 PM | 9/25/2024 2:29:36 PM | 1 |
| 14636 | Bus_002 | 699.625 | 9/25/2024 | 2:29:36 PM | 9/25/2024 2:29:36 PM | 1 |
| 14637 | Bus_002 | 699.375 | 9/25/2024 | 2:29:37 PM | 9/25/2024 2:29:37 PM | 1 |
| 14638 | Bus_002 | 700.75 | 9/25/2024 | 2:29:37 PM | 9/25/2024 2:29:37 PM | 1 |
| 14639 | Bus_002 | 700.375 | 9/25/2024 | 2:29:37 PM | 9/25/2024 2:29:37 PM | 1 |
| 14900 | Bus_002 | 700.25 | 9/25/2024 | 2:31:58 PM | 9/25/2024 2:31:58 PM | 141 |
| 14901 | Bus_003 | 699.75 | 9/25/2024 | 2:31:58 PM | 9/25/2024 2:31:58 PM | 1 |
| 14902 | Bus_003 | 699.875 | 9/25/2024 | 2:31:59 PM | 9/25/2024 2:31:59 PM | 1 |
| 14903 | Bus_003 | 700.125 | 9/25/2024 | 2:31:59 PM | 9/25/2024 2:31:59 PM | 1 |
| 14904 | Bus_003 | 700.5 | 9/25/2024 | 2:32:03 PM | 9/25/2024 2:32:03 PM | 4 |
| 14931 | Bus_003 | 700 | 9/25/2024 | 2:32:13 PM | 9/25/2024 2:32:13 PM | 10 |
| 14932 | Bus_003 | 699.625 | 9/25/2024 | 2:32:13 PM | 9/25/2024 2:32:13 PM | 1 |
| 14933 | Bus_003 | 701.25 | 9/25/2024 | 2:32:14 PM | 9/25/2024 2:32:14 PM | 0 |
| 14934 | Bus_003 | 699.5 | 9/25/2024 | 2:32:15 PM | 9/25/2024 2:32:15 PM | 1 |
| 14935 | Bus_003 | 699.5 | 9/25/2024 | 2:32:15 PM | 9/25/2024 2:32:15 PM | 1 |
| 14936 | Bus_003 | 701 | 9/25/2024 | 2:32:15 PM | 9/25/2024 2:32:15 PM | 0 |
| 14937 | Bus_003 | 699.875 | 9/25/2024 | 2:32:16 PM | 9/25/2024 2:32:16 PM | 1 |
| 14938 | Bus_003 | 700.5 | 9/25/2024 | 2:32:16 PM | 9/25/2024 2:32:16 PM | 1 |
| 14939 | Bus_003 | 700.25 | 9/25/2024 | 2:32:16 PM | 9/25/2024 2:32:16 PM | 1 |