As you can see, the last one at 17.46 had the planned event type as departure and the train terminated to false?
planned_timestamp actual_timestamp planned_event_type train_terminated
2015-10-30 16:35:00 2015-10-30 16:30:00 DEPARTURE false
2015-10-30 16:37:00 2015-10-30 16:36:00 DEPARTURE false
2015-10-30 16:48:00 2015-10-30 16:42:00 DEPARTURE false
2015-10-30 17:07:00 2015-10-30 17:07:00 DEPARTURE false
2015-10-30 17:26:00 2015-10-30 17:22:00 DEPARTURE false
2015-10-30 17:31:00 2015-10-30 17:28:00 DEPARTURE false
2015-10-30 17:38:00 2015-10-30 17:36:00 DEPARTURE false
2015-10-30 17:44:00 2015-10-30 17:44:00 ARRIVAL false
2015-10-30 18:05:00 2015-10-30 17:45:00 DEPARTURE false
2015-10-30 18:09:00 2015-10-30 17:46:00 ARRIVAL false
2015-10-30 18:09:00 2015-10-30 17:46:00 ARRIVAL false
I have notice that this train is cancelled now, But not sure if it was 15:35 or 16:35 as this due to the dodgy time formats in UK DST.
id msg_type source_dev_id user_id original_data_source msg_queue_timestamp source_system_id train_id orig_loc_stanox orig_loc_timestamp toc_id dep_timestamp division_code loc_stanox canx_timestamp canx_reason_code canx_type train_service_code train_file_address
69 0002 V03C #PEE0129 SDR 2015-10-30 16:01:16 TRUST 234R72CT30 NULL NULL 54 2015-10-30 15:35:00 54 23451 2015-10-30 16:01:00 FL AT ORIGIN 51462180 GK4
114 0002 SV2W #PEE0088 SDR 2015-10-30 20:20:16 TRUST 234R72CT30 NULL NULL 54 2015-10-30 17:33:00 54 21415 2015-10-30 20:20:00 FL EN ROUTE 51462180 GK4
157 0002 VNHU #PEE0088 SDR 2015-10-31 01:49:35 TRUST 234R72CT30 NULL NULL 54 2015-10-30 17:33:00 54 21415 2015-10-31 01:49:00 FL EN ROUTE 51462180 GK4
158 0002 VNHU #PEE0088 SDR 2015-10-31 01:52:42 TRUST 234R72CT30 NULL NULL 54 2015-10-30 17:33:00 54 21415 2015-10-31 01:52:00 FL EN ROUTE 51462180 GK4
My question still stands, if a train is cancelled then does that mean it has terminated or just stays open?
What I am trying to do is get the percentage of trains that have terminated between two dates.
Many thanks
Andrew