How to calculate SLA Compliance Rate

SLA compliance rate is the share of tickets resolved or answered within the time promised in your service level agreement.

Formula

SLA compliance = tickets resolved within the SLA target ÷ tickets that had an SLA

SQL query

This example assumes: tickets(id, created_at timestamptz, resolved_at timestamptz, sla_hours numeric). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.

SELECT DATE_TRUNC('month', created_at)::date AS month,
       COUNT(*) AS tickets,
       COUNT(*) FILTER (
         WHERE resolved_at IS NOT NULL
           AND resolved_at <= created_at + sla_hours * INTERVAL '1 hour') AS within_sla,
       COUNT(*) FILTER (
         WHERE resolved_at IS NOT NULL
           AND resolved_at <= created_at + sla_hours * INTERVAL '1 hour')::numeric / NULLIF(COUNT(*), 0) AS sla_compliance
FROM tickets
WHERE sla_hours IS NOT NULL
GROUP BY 1
ORDER BY 1;

Common mistakes that make SLA Compliance Rate wrong

  • Tickets still open and past their deadline are breaches; do not drop them from the denominator.
  • If the SLA clock pauses (waiting on the customer) or uses business hours, a simple timestamp difference is wrong.
  • Different priorities have different targets; report each priority as well as the total.

Ask for SLA Compliance Rate in plain English

Instead of writing the query yourself, you can type the question. SchemaChat turns it into SQL against your connected database or uploaded file, runs it, and shows the SQL and the figures it used so you can check the answer before you share it. It does not replace your judgement about the definition: check that the query matches the formula your business uses.

  • What was our SLA compliance rate each month this year?
  • Which priority level breaches its SLA most often?

Frequently asked questions

What is SLA Compliance Rate?
SLA compliance rate is the share of tickets resolved or answered within the time promised in your service level agreement.
How do you calculate SLA Compliance Rate?
SLA compliance = tickets resolved within the SLA target ÷ tickets that had an SLA. The SQL example on this page shows the same calculation against a simple table.
What commonly goes wrong when calculating SLA Compliance Rate?
Tickets still open and past their deadline are breaches; do not drop them from the denominator.