Skip to main content

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:

5IMLGXVyBlCQ7Z97Qf1baIKRtYkBYUQbWT_urrsFiIDX5Pyzs5JPzTtIIxuz32Rm4piIGFt6GXsz8XfqwAja5XnsZgamn7Un9qjPTRQ3xNSQeOHP13DLwveFHsO2bWkWKs3CdN79

These measures return the timeframe in the number of seconds:

qxzs2Pm1KMIMtC0shOgqLy2gI9ygHzckTjOMjpUTyq9NclnDmtQ9X-jbste_tcPRXIms_1trezY92s46GdQWcAi5XkJ53XT_2Lns6IYs0Nty8Po_2eIWUmmn4BczRC_OPwxpSNCd

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:

  1. Expand the Custom Fields section of the CAD Data Explorer
  2. Click the tNEW] button
  3. 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  and the three new dimensions will show the corresponding measure value in a mm:ss format:

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):