How to calculate On-Time In-Full (OTIF)

OTIF is the share of orders delivered both on time and with the complete quantity ordered.

Formula

OTIF % = orders delivered on time and in full ÷ total orders delivered × 100

SQL query

This example assumes: orders(id, promised_date, delivered_date, qty_ordered, qty_delivered). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.

SELECT COUNT(*) FILTER (WHERE delivered_date <= promised_date
                              AND qty_delivered >= qty_ordered) * 100.0
         / NULLIF(COUNT(*), 0) AS otif_pct
FROM orders
WHERE delivered_date IS NOT NULL;

Common mistakes that make On-Time In-Full (OTIF) wrong

  • Define 'in full' (exact or within a tolerance) and keep it constant.
  • Orders with several lines must be judged per order, not per line, unless you say so.
  • Partial shipments that complete later are late for OTIF purposes under the strict rule.

Ask for On-Time In-Full (OTIF) 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 OTIF rate by customer last month?
  • Which products most often cause short deliveries?

Frequently asked questions

What is On-Time In-Full (OTIF)?
OTIF is the share of orders delivered both on time and with the complete quantity ordered.
How do you calculate On-Time In-Full (OTIF)?
OTIF % = orders delivered on time and in full ÷ total orders delivered × 100. The SQL example on this page shows the same calculation against a simple table.
What commonly goes wrong when calculating On-Time In-Full (OTIF)?
Define 'in full' (exact or within a tolerance) and keep it constant.