Set an Alert on average Turn Around Time of orders

Problem Alert Action Impact
Higher Turn around Times being observed Get alerted when Average TAT > threshold (set according to areas and routes) Check for underlying factors and increase delivery personnel in delayed routes or areas. (or) Check for bottlenecks in transit Reducing TATs will improve Customer satisfaction and help you draft competitive SLAs to attract more customers.

Step-by-step guide

Step 1: Choose an Alert type

Choose the SQL Metric based alert to trigger an alert when the average TAT drops below the critical threshold.

Step 2: Write an SQL query to fetch a value

Sample Query - to calculate the average TAT for all the orders created in the last week for your hub.

Code Display Example

SELECT AVG(closed_at_timestamp - created_at_timestamp) as avg_tat
FROM orders
WHERE status = “Closed”
AND created_at_timestamp BETWEEN GETDATE() AND (GETDATE() - 7)
AND delivery_hub = #{{your_hub}}
        

SELECT AVG(closed_at_timestamp - created_at_timestamp) as avg_tat

FROM orders

WHERE status = “Closed”

AND created_at_timestamp BETWEEN GETDATE() AND (GETDATE() - 7)

AND delivery_hub = #{{your_hub}}

Step 3: Configure Alert Condition

  • Alert Frequency: 24 Hrs
  • Column: avg_tat
  • Operator: >
  • Value: #{{critical_threshold}}

Step 4: Configure Team and Assignees

  • Team is responsible for this alert (optional) -
  • Person assigned to the incidents (optional) -

Step 5: Configure Alert and Incident Details

  • Alert name: Average Turn Around Time Alert
  • Configure Incident Tile:  Avg. TAT for orders in last 7 days is high at #{{avg_tat}}.
  • Default Incident Priority: Medium

Step 6: Setup Notifications

  • Channel: email
  • id: #{{}}
  • Escalation:
    • Duration: 24 Hrs
    • Member: Senior Manager
    • Channel: email