How to calculate Overall Equipment Effectiveness (OEE)
OEE measures how well manufacturing equipment is used by combining availability, performance and quality.
Formula
OEE = availability × performance × quality (each as a fraction of 1)SQL query
This example assumes: machine_shifts(machine, shift_date, planned_minutes, run_minutes, ideal_units, actual_units, good_units). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.
SELECT machine,
(SUM(run_minutes) * 1.0 / NULLIF(SUM(planned_minutes), 0))
* (SUM(actual_units) * 1.0 / NULLIF(SUM(ideal_units), 0))
* (SUM(good_units) * 1.0 / NULLIF(SUM(actual_units), 0)) AS oee
FROM machine_shifts
GROUP BY machine
ORDER BY oee;Common mistakes that make Overall Equipment Effectiveness (OEE) wrong
- Ideal units must be based on the ideal cycle time over the run time, or performance is meaningless.
- Planned downtime is excluded from planned minutes by convention; be explicit.
- A single OEE number hides which factor is the problem; show all three.
Ask for Overall Equipment Effectiveness (OEE) 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 is OEE by machine for last month?
- Is availability, performance or quality the biggest loss?