There are three measures included in analytics for analyzing an agency’s response time to CAD events. They are found in the CAD Data Explorer - Agency Events section:
These measures return the timeframe in the number of seconds:
Many times, this information may be more useful in a mm:ss format. We can change the display of these data using custom dimensions. Create three new custom dimensions using the code below. To create a custom dimension:
- Expand the Custom Fields section of the CAD Data Explorer
- Click the tNEW] button
- Choose Custom Dimension
Average Created to Dispatch (mm:ss)
concat(
if(
diff_minutes(${vw_agency_events.event_time},${vw_agency_events.first_dispatch_time}) < 10,
concat("0", diff_minutes(${vw_agency_events.event_time},${vw_agency_events.first_dispatch_time})),
concat(diff_minutes(${vw_agency_events.event_time},${vw_agency_events.first_dispatch_time}), "")
),
":",
if(
mod(diff_seconds(${vw_agency_events.event_time},${vw_agency_events.first_dispatch_time}), 60) < 10,
concat("0", mod(diff_seconds(${vw_agency_events.event_time},${vw_agency_events.first_dispatch_time}), 60)),
concat(mod(diff_seconds(${vw_agency_events.event_time},${vw_agency_events.first_dispatch_time}), 60), "")
)
)
Average Dispatch to Enroute (mm:ss)
concat(
if(
diff_minutes(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_enroute_time}) < 10,
concat("0", diff_minutes(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_enroute_time})),
concat(diff_minutes(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_enroute_time}), "")
),
":",
if(
mod(diff_seconds(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_enroute_time}), 60) < 10,
concat("0", mod(diff_seconds(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_enroute_time}), 60)),
concat(mod(diff_seconds(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_enroute_time}), 60), "")
)
)
Average Enroute to Arrival (mm:ss)
concat(
if(
diff_minutes(${vw_agency_events.first_enroute_time},${vw_agency_events.first_arrival_time}) < 10,
concat("0", diff_minutes(${vw_agency_events.first_enroute_time},${vw_agency_events.first_arrival_time})),
concat(diff_minutes(${vw_agency_events.first_enroute_time},${vw_agency_events.first_arrival_time}), "")
),
":",
if(
mod(diff_seconds(${vw_agency_events.first_enroute_time},${vw_agency_events.first_arrival_time}), 60) < 10,
concat("0", mod(diff_seconds(${vw_agency_events.first_enroute_time},${vw_agency_events.first_arrival_time}), 60)),
concat(mod(diff_seconds(${vw_agency_events.first_enroute_time},${vw_agency_events.first_arrival_time}), 60), "")
)
)
Once the custom dimensions are created, you should see them in the Custom Fields category:
Click
You can now remove the measures or hide them from your visualization to see only the results in mm:ss format:
You can also create a custom time frame. We looked at Dispatch to Enroute and Enroute to Arrival, but you may want Dispatch right through to Arrival. You can easily do that by reusing the Average Dispatch to Enroute (mm:ss) code and changing the second time value to the first arrival time. Here is a fourth custom dimension:
Average Dispatch to Arrival (mm:ss)
concat(
if(
diff_minutes(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_arrival_time}) < 10,
concat("0", diff_minutes(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_arrival_time})),
concat(diff_minutes(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_arrival_time}), "")
),
":",
if(
mod(diff_seconds(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_arrival_time}), 60) < 10,
concat("0", mod(diff_seconds(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_arrival_time}), 60)),
concat(mod(diff_seconds(${vw_agency_events.first_dispatch_time},${vw_agency_events.first_arrival_time}), 60), "")
)
)
You can see the new Average Dispatch to Arrival (mm:ss) is equal to the sum of Average Dispatch to Enroute (mm:ss) and Average Enroute to Arrival (mm:ss):