I'm using the formula below to calculate "actHdwy". However the formula places the "actHdwy" next to wrong vehicle.
For example, vehicle 5005 does not have "actHdwy" of 11 minutes, bus 5007 should be 11 minutes.
Vehicle 5017 should be 19 minutes, vehicle 5008 should be 11 minutes, 5013 should 16 minutes, etc.,
In other words, how can I modify the formula below to shift the "actHdwy" down to the correct vehicle?
Thanks for any assistance.
WhilePrintingRecords; //Place in Group Footer
if {command.vehicle_id} <> Next({command.vehicle_id}) then
(
Time(next({command.incident_date_time})) -
Time(Minimum ({command.incident_date_time}, {command.vehicle_id}))
)/60
else 0;
incDate sched_time actHdwy vehicle_id
5:10:54 AM 5:07 AM 0 5005
5:13:54 AM 5:07 AM 0 5005
5:15:54 AM 5:07 AM 11 5005
5:21:54 AM 5:22 AM 19 5007
5:40:54 AM 5:37 AM 11 5017
5:51:56 AM 5:52 AM 16 5008
6:07:55 AM 6:07 AM 18 5013
6:25:56 AM 6:22 AM 5 5020
6:30:55 AM 6:34 AM 0 5021
6:40:55 AM 6:34 AM 17 5021
6:47:55 AM 6:49 AM 16 5011
7:03:55 AM 7:04 AM 13 5015
7:16:56 AM 7:16 AM 12 5002
7:28:56 AM 7:28 AM 0 5006
7:30:56 AM 7:28 AM 13 5006
7:41:56 AM 7:40 AM 9 5019
7:50:56 AM 7:52 AM 12 5066
8:02:56 AM 8:04 AM 0 5014
8:04:56 AM 8:04 AM 0 5014
8:06:56 AM 8:04 AM 11 5014
8:13:56 AM 8:16 AM 12 5022
8:25:56 AM 8:28 AM 0 5012
8:26:56 AM 8:28 AM 0 5012
8:27:56 AM 8:28 AM 0 5012
8:31:56 AM 8:28 AM 21 5012
8:46:57 AM 8:42 AM 9 5005
For example, vehicle 5005 does not have "actHdwy" of 11 minutes, bus 5007 should be 11 minutes.
Vehicle 5017 should be 19 minutes, vehicle 5008 should be 11 minutes, 5013 should 16 minutes, etc.,
In other words, how can I modify the formula below to shift the "actHdwy" down to the correct vehicle?
Thanks for any assistance.
WhilePrintingRecords; //Place in Group Footer
if {command.vehicle_id} <> Next({command.vehicle_id}) then
(
Time(next({command.incident_date_time})) -
Time(Minimum ({command.incident_date_time}, {command.vehicle_id}))
)/60
else 0;
incDate sched_time actHdwy vehicle_id
5:10:54 AM 5:07 AM 0 5005
5:13:54 AM 5:07 AM 0 5005
5:15:54 AM 5:07 AM 11 5005
5:21:54 AM 5:22 AM 19 5007
5:40:54 AM 5:37 AM 11 5017
5:51:56 AM 5:52 AM 16 5008
6:07:55 AM 6:07 AM 18 5013
6:25:56 AM 6:22 AM 5 5020
6:30:55 AM 6:34 AM 0 5021
6:40:55 AM 6:34 AM 17 5021
6:47:55 AM 6:49 AM 16 5011
7:03:55 AM 7:04 AM 13 5015
7:16:56 AM 7:16 AM 12 5002
7:28:56 AM 7:28 AM 0 5006
7:30:56 AM 7:28 AM 13 5006
7:41:56 AM 7:40 AM 9 5019
7:50:56 AM 7:52 AM 12 5066
8:02:56 AM 8:04 AM 0 5014
8:04:56 AM 8:04 AM 0 5014
8:06:56 AM 8:04 AM 11 5014
8:13:56 AM 8:16 AM 12 5022
8:25:56 AM 8:28 AM 0 5012
8:26:56 AM 8:28 AM 0 5012
8:27:56 AM 8:28 AM 0 5012
8:31:56 AM 8:28 AM 21 5012
8:46:57 AM 8:42 AM 9 5005