๐Ÿ“Š SQL View Documentation

Employee & Resource
Efficiency Report

Complete field-level reference for the PostgreSQL view mrp_19_emp_res_eff โ€” every output column, its Odoo source table and CTE, and all calculated formulas explained with technical field names and SQL logic. Covers Employee KPIs, Workcenter KPIs, and OEE calculations.

View Name
mrp_19_emp_res_eff
Total Columns
39
CTEs
4
Source Tables
16
Calculated Fields
20
Report Grain
1 row per Employee ร— Workorder
๐Ÿ”— CTE Architecture
๐Ÿ—„๏ธ Source Tables
๐Ÿ” Filter Fields
๐Ÿ‘ค Employee KPIs
โš™๏ธ Workcenter KPIs
๐Ÿ“ˆ OEE Fields
๐Ÿ—‚๏ธ Quick Reference
๐Ÿ”—

CTE Architecture

4 Common Table Expressions that pre-aggregate data before the main SELECT

โ„น๏ธ
The view uses a CTE-first pattern โ€” all heavy aggregation happens in 4 named CTEs, and the main SELECT only joins and formats the results. This prevents row multiplication and ensures all metrics are pre-aggregated at the correct grain.

CTE 1 โ€” employee_productivity

Aggregates actual working minutes per employee per workorder from the workcenter productivity log. Captures the resource calendar the employee was working under.

SELECT wp.workorder_id, wp.employee_id, SUM(wp.duration) AS employee_working_minutes, MAX(wp.resource_calendar_id) AS resource_calendar_id FROM mrp_workcenter_productivity wp WHERE wp.employee_id IS NOT NULL GROUP BY wp.workorder_id, wp.employee_id -- Grain: one row per (employee ร— workorder) -- Source: mrp_workcenter_productivity -- Key output: employee_working_minutes, resource_calendar_id

CTE 2 โ€” workorder_employee_count

Counts the number of distinct employees who logged time on each workorder. Used to split planned_runtime proportionally across employees.

SELECT workorder_id, COUNT(DISTINCT employee_id) AS employee_count FROM employee_productivity -- reads CTE 1 GROUP BY workorder_id -- Grain: one row per workorder -- Key output: employee_count

CTE 3 โ€” workorder_output

Aggregates finished product outputs (estimated_units, net_weight, lot names) from stock move lines. Resolves workorder_id from both stock_move and mrp_output_log to handle cases where workorder_id on the move is NULL.

SELECT COALESCE(sm.workorder_id, ol.workorder_id) AS workorder_id, sm.product_id, SUM(sml.estimated_units) AS estimated_units, SUM(sml.net_weight) AS net_weight, STRING_AGG(DISTINCT COALESCE(sml.lot_name, lot.name), ', ') AS lot_name FROM stock_move sm JOIN stock_move_line sml ON sml.move_id = sm.id LEFT JOIN stock_lot lot ON sml.lot_id = lot.id LEFT JOIN mrp_output_log ol ON sm.output_log_id = ol.id WHERE (sm.workorder_id IS NOT NULL OR ol.workorder_id IS NOT NULL) AND sm.production_id IS NOT NULL AND sm.raw_material_production_id IS NULL -- finished goods only, exclude raw material returns GROUP BY COALESCE(sm.workorder_id, ol.workorder_id), sm.product_id -- Grain: one row per (workorder ร— product) -- Sources: stock_move, stock_move_line, stock_lot, mrp_output_log

CTE 4 โ€” employee_output

Aggregates quantity and weight produced per employee per workorder directly from the output log (only 'done' state entries). Provides the employee-level production figures.

SELECT workorder_id, employee_id, COALESCE(SUM(estimated_units), 0.0) AS quantity_produced, COALESCE(SUM(net_weight), 0.0) AS weight_produced FROM mrp_output_log WHERE state = 'done' GROUP BY workorder_id, employee_id -- Grain: one row per (employee ร— workorder) -- Source: mrp_output_log (done entries only) -- Key output: quantity_produced, weight_produced
๐Ÿ—„๏ธ

Source Tables & Joins

All PostgreSQL / Odoo tables referenced in the view

mrp_workorder

  • Core driver (alias: wo)
  • INNER JOIN via employee_productivity
  • id, name, state
  • duration_expected
  • total_actual_workcenter_time
  • production_id, operation_id
  • workcenter_id

mrp_production

  • alias: mp
  • LEFT JOIN on mp.id = wo.production_id
  • id, name
  • product_id
  • create_date

mrp_routing_workcenter

  • alias: rw
  • LEFT JOIN on wo.operation_id
  • time_cycle_manual (Ideal Cycle Time)

mrp_workcenter_productivity

  • alias: wp (in CTE 1)
  • workorder_id, employee_id
  • duration (minutes)
  • resource_calendar_id

mrp_output_log

  • Used in CTE 4 directly
  • Used in CTE 3 (LEFT JOIN)
  • workorder_id, employee_id
  • estimated_units, net_weight
  • state (filtered = 'done')

mrp_workcenter

  • alias: wc
  • LEFT JOIN on wo.workcenter_id
  • name
  • resource_calendar_id

hr_employee

  • alias: emp
  • LEFT JOIN on ep.employee_id
  • id, name
  • resource_id (FK)

resource_resource

  • alias: res
  • LEFT JOIN on emp.resource_id
  • calendar_id (fallback for rc_emp)

resource_calendar

  • alias: rc_emp (employee calendar)
  • alias: rc_wc (workcenter calendar)
  • hours_per_day
  • rc_emp JOIN: COALESCE(ep.resource_calendar_id, res.calendar_id, wc.resource_calendar_id)

stock_move

  • alias: sm (in CTE 3)
  • workorder_id, output_log_id
  • product_id, production_id
  • raw_material_production_id

stock_move_line

  • alias: sml (in CTE 3)
  • estimated_units (custom)
  • net_weight (custom)
  • lot_name, lot_id, move_id

stock_lot

  • alias: lot (in CTE 3)
  • LEFT JOIN on sml.lot_id
  • name (fallback for lot_name)

product_product

  • alias: pp
  • JOIN: COALESCE(wo_output.product_id, mp.product_id)
  • product_tmpl_id
  • province_code (custom)

product_template

  • alias: pt
  • JOIN on pp.product_tmpl_id
  • name (JSONB)
  • categ_id, product_format_id

product_format

  • alias: pf (custom table)
  • LEFT JOIN on pt.product_format_id
  • name

src_type / src_category

  • alias: st, sc (custom tables)
  • Via product_category โ†’ pc
  • name
๐Ÿ“

Report Grain

What does one row represent?

โš ๏ธ
One row = One Employee ร— One Workorder.
The view is driven by INNER JOIN employee_productivity ep ON ep.workorder_id = wo.id. This means only workorders that have at least one employee productivity log entry appear. Each unique (employee, workorder) pair produces one row.

Workcenter-level fields (runtime_minutes, workcenter_quantity_produced, units_per_minute, units_per_hour, machine_utilization_pct, total_available_machine_time, workcenter_efficiency_pct) are protected by ROW_NUMBER() OVER (PARTITION BY wo.id ORDER BY ep.employee_id) = 1 guards so that SUM in Power BI does not double-count machine-level metrics across multiple employees on the same WO.
๐Ÿ”

Filter / Dimension Fields

Identification and slicing fields โ€” direct column reads

employee_name Full Name of the Employee
Dimension
โ–ผ
Source Tablehr_employee (emp)
Source Columnemp.name
Joinemp.id = ep.employee_id (LEFT JOIN)
DescriptionFull name of the employee who logged time on the workorder. Primary slicer for employee-level analysis.
workorder_name Workorder / Operation Name
Dimension
โ–ผ
Source Tablemrp_workorder (wo)
Source Columnwo.name
DescriptionName of the manufacturing operation (e.g. "Milling", "Drying", "Packaging"). Also exposed as work_order in the workcenter section.
mo_name & manufacturing_order Manufacturing Order Reference
Dimension
โ–ผ
Source Tablemrp_production (mp)
Source Columnmp.name
Joinmp.id = wo.production_id (LEFT JOIN)
DescriptionManufacturing order reference (e.g. WH/MO/00214). Exposed twice โ€” as mo_name for employee section and manufacturing_order for workcenter section.
workcenter_name & workcenter Workcenter Where Operation Was Performed
Dimension
โ–ผ
Source Tablemrp_workcenter (wc)
Source Columnwc.name
Joinwc.id = wo.workcenter_id (LEFT JOIN)
product_name & product Finished Product Name
Calculated
โ–ผ
Join Chainproduct_product โ†’ product_template
Product ResolutionCOALESCE(wo_output.product_id, mp.product_id)
Formula
pt.name->>'en_US' -- product_product joined on: -- COALESCE(wo_output.product_id, mp.product_id) -- First tries the actual output product from workorder_output CTE -- Falls back to MO final product if no output stock moves exist yet
DescriptionResolves to the specific product produced at the workorder level (from workorder_output CTE), falling back to the MO-level finished product. Exposed twice for filtering flexibility.
province_code Product Province / Region Code
Dimension
โ–ผ
Source Columnpp.province_code โ€” custom field on product_product
product_format Product Format Classification
Dimension
โ–ผ
Source Tableproduct_format (pf) โ€” custom table
Joinpt.product_format_id = pf.id (LEFT JOIN)
src_type & src_category Source Type & Category
Dimension
โ–ผ
Join Chainproduct_template โ†’ product_category โ†’ src_type / src_category
Source Columnsst.name, sc.name
lot_name Lot / Batch Name of the Output
Dimension
โ–ผ
SourceCTE 3: workorder_output
Formula
-- In workorder_output CTE: STRING_AGG(DISTINCT COALESCE(sml.lot_name, lot.name), ', ') -- sml.lot_name = stored lot name on move line (custom field) -- lot.name = name from stock_lot (fallback via sml.lot_id) -- COALESCE picks whichever is available first -- STRING_AGG concatenates all distinct lot names with ', '
DescriptionComma-separated list of all distinct lot/batch names produced on this workorder. Useful for traceability.
mo_creation_date MO Created On
Dimension
โ–ผ
Source Columnmp.create_date
Data TypeTIMESTAMP WITH TIME ZONE
DescriptionWhen the manufacturing order was created. Primary date dimension for time-series and trend analysis in Power BI.
๐Ÿ‘ค

Employee Resource Efficiency Fields

One value per employee per workorder โ€” no dedup guard needed

quantity_produced Units Produced by This Employee on This WO
Calculated
โ–ผ
SourceCTE 4: employee_output (alias: eo)
Source Tablemrp_output_log
Formula
COALESCE(eo.quantity_produced, 0.0) -- eo.quantity_produced = COALESCE(SUM(estimated_units), 0.0) -- from mrp_output_log WHERE state = 'done' -- Joined on: eo.workorder_id = wo.id AND eo.employee_id = emp.id -- COALESCE outer guard for unmatched employees
DescriptionActual finished units recorded by this employee on this workorder. Sourced from done output log entries.
weight_produced Net Weight Produced by This Employee (grams)
Calculated
โ–ผ
SourceCTE 4: employee_output (alias: eo)
Formula
COALESCE(eo.weight_produced, 0.0) -- eo.weight_produced = COALESCE(SUM(net_weight), 0.0) -- from mrp_output_log WHERE state = 'done'
employee_working_minutes Actual Minutes Logged by This Employee
Employee
โ–ผ
SourceCTE 1: employee_productivity (alias: ep)
Formula
ep.employee_working_minutes -- = SUM(wp.duration) FROM mrp_workcenter_productivity -- WHERE wp.employee_id IS NOT NULL -- GROUP BY wp.workorder_id, wp.employee_id
DescriptionTotal minutes the employee was logged as active on this workorder's productivity timer. Direct input for all efficiency ratios.
employee_working_hours Working Minutes Converted to Hours
Calculated
โ–ผ
Formula
ep.employee_working_minutes / 60.0 -- Simple conversion: minutes รท 60 = hours
units_per_employee_per_hour Throughput per Active Employee Labor Hour
Calculated
โ–ผ
Formula
CASE WHEN COALESCE(ep.employee_working_minutes, 0) > 0 THEN COALESCE(eo.quantity_produced, 0.0) / (ep.employee_working_minutes / 60.0) ELSE NULL END -- Numerator: eo.quantity_produced (done units from employee_output CTE) -- Denominator: employee hours worked (emp_working_minutes / 60) -- Returns NULL (not 0) when no time logged โ€” prevents distorting averages
InterpretationHigher = more units per hour of employee labor. Key individual productivity KPI.
standard_time Standard (Planned) Duration for the Operation (minutes)
Employee
โ–ผ
Source Tablemrp_workorder (wo)
Source Columnwo.duration_expected
DescriptionPlanned/standard time set on the workorder routing. The benchmark used in efficiency and availability calculations.
actual_time Actual Machine Runtime for the Operation (minutes)
Employee
โ–ผ
Source Tablemrp_workorder (wo)
Source Columnwo.total_actual_workcenter_time
DescriptionActual workcenter machine runtime in minutes. Used in OEE availability and performance calculations.
employee_efficiency_pct Employee Time Efficiency Percentage
Calculated
โ–ผ
Formula
CASE WHEN COALESCE(ep.employee_working_minutes, 0) > 0 THEN (wo.duration_expected / ep.employee_working_minutes) * 100.0 ELSE NULL END -- wo.duration_expected = standard/planned minutes (mrp_workorder) -- ep.employee_working_minutes = actual minutes logged by this employee (CTE 1) -- > 100% โ†’ employee finished faster than planned (efficient) -- < 100% โ†’ employee took longer than planned (inefficient) -- Returns NULL when no time logged
Interpretation>100% = faster than standard. <100% = slower than standard. Measures how well the employee performed against the routing target.
total_available_labour_time Employee's Daily Shift Hours from Resource Calendar
Employee
โ–ผ
Source Tableresource_calendar (alias: rc_emp)
Source Columnrc_emp.hours_per_day
Calendar Resolution
LEFT JOIN resource_calendar rc_emp ON rc_emp.id = COALESCE( ep.resource_calendar_id, -- from mrp_workcenter_productivity (CTE 1) res.calendar_id, -- from resource_resource linked to hr_employee wc.resource_calendar_id -- workcenter calendar as final fallback )
DescriptionDaily available working hours from the employee's resource calendar. Used as the denominator in labour utilization. Falls back through 3 sources to find the best available calendar.
labour_utilization_pct Employee Labour Utilization Percentage
Calculated
โ–ผ
Formula
CASE WHEN COALESCE(rc_emp.hours_per_day, 0) > 0 THEN ((ep.employee_working_minutes / 60.0) / rc_emp.hours_per_day) * 100.0 ELSE NULL END -- ep.employee_working_minutes / 60.0 = actual employee hours worked -- rc_emp.hours_per_day = scheduled available hours (resource_calendar) -- Returns NULL when no calendar configured
Interpretation100% = employee fully utilized all scheduled shift hours. >100% = overtime. Measures scheduling efficiency.
attendance_to_output_ratio Throughput per Standard 6-Day Work Week
Calculated
โ–ผ
Formula
COALESCE(eo.quantity_produced, 0.0) / 6.0 -- Divides employee's quantity_produced by 6.0 -- 6.0 = assumed scheduled work days per week (hard-coded constant) -- Provides a daily production rate proxy
DescriptionMeasures daily production throughput by dividing total units by the 6-day scheduled work week constant. A simple proxy for daily output rate per employee.
โš™๏ธ

Workcenter Resource Efficiency Fields

Machine-level KPIs โ€” protected by ROW_NUMBER() dedup guard to prevent double-counting across employees

โš ๏ธ
Fields marked with ROW_NUMBER guard emit the real value only for the first employee record (ordered by ep.employee_id) in each workorder partition, and 0.0 for all subsequent employees. This ensures Power BI SUM gives the correct per-workorder total even when multiple employees share one WO.
workcenter_quantity_produced Total WO Output Units โ€” ROW_NUMBER Guard
Calculated
โ–ผ
SourceCTE 3: workorder_output (alias: wo_output)
Formula
CASE WHEN ROW_NUMBER() OVER (PARTITION BY wo.id ORDER BY ep.employee_id) = 1 THEN wo_output.estimated_units ELSE 0.0 END -- wo_output.estimated_units = SUM(sml.estimated_units) -- from workorder_output CTE (stock_move_line) -- Only first employee row per WO carries the value
DescriptionTotal units produced at the workorder (machine) level. Assigned to only the first employee row to prevent double-counting when multiple employees worked on the same WO.
runtime_minutes Actual Machine Runtime โ€” ROW_NUMBER Guard (minutes)
Calculated
โ–ผ
Source Columnwo.total_actual_workcenter_time
Formula
CASE WHEN ROW_NUMBER() OVER (PARTITION BY wo.id ORDER BY ep.employee_id) = 1 THEN wo.total_actual_workcenter_time ELSE 0.0 END -- wo.total_actual_workcenter_time = machine-level runtime from mrp_workorder
planned_runtime Planned Runtime Split Proportionally by Employee Count (minutes)
Calculated
โ–ผ
Formula
CASE WHEN COALESCE(wec.employee_count, 0) > 0 THEN wo.duration_expected / wec.employee_count ELSE 0.0 END -- wo.duration_expected = planned/standard minutes (mrp_workorder) -- wec.employee_count = COUNT(DISTINCT employee_id) from workorder_employee_count CTE (CTE 2) -- Divides the total planned time equally among all employees on the WO -- Returns 0.0 when no employees counted
DescriptionEach employee's fair share of the planned operation time. Used to assess individual contribution against the proportional plan.
workcenter_efficiency_pct Workcenter Time Efficiency % โ€” ROW_NUMBER Guard
Calculated
โ–ผ
Formula
CASE WHEN ROW_NUMBER() OVER (PARTITION BY wo.id ORDER BY ep.employee_id) = 1 AND COALESCE(wo.total_actual_workcenter_time, 0) > 0 THEN (wo.duration_expected / wo.total_actual_workcenter_time) * 100.0 ELSE 0.0 END -- wo.duration_expected = planned minutes -- wo.total_actual_workcenter_time = actual machine minutes -- > 100% โ†’ machine ran faster than planned -- < 100% โ†’ machine ran slower than planned
units_per_minute Machine Throughput in Units per Minute โ€” ROW_NUMBER Guard
Calculated
โ–ผ
Formula
CASE WHEN ROW_NUMBER() OVER (PARTITION BY wo.id ORDER BY ep.employee_id) = 1 AND COALESCE(wo.total_actual_workcenter_time, 0) > 0 THEN wo_output.estimated_units / wo.total_actual_workcenter_time ELSE 0.0 END -- Numerator: wo_output.estimated_units (CTE 3: SUM of output units) -- Denominator: wo.total_actual_workcenter_time (minutes)
units_per_hour Machine Throughput in Units per Hour โ€” ROW_NUMBER Guard
Calculated
โ–ผ
Formula
CASE WHEN ROW_NUMBER() OVER (PARTITION BY wo.id ORDER BY ep.employee_id) = 1 AND COALESCE(wo.total_actual_workcenter_time, 0) > 0 THEN wo_output.estimated_units / (wo.total_actual_workcenter_time / 60.0) ELSE 0.0 END -- Numerator: wo_output.estimated_units -- Denominator: actual machine hours (total_actual_workcenter_time / 60)
total_available_machine_time Machine Daily Operating Limit from Calendar โ€” ROW_NUMBER Guard (hours)
Calculated
โ–ผ
Source Tableresource_calendar (alias: rc_wc)
Joinrc_wc.id = wc.resource_calendar_id
Formula
CASE WHEN ROW_NUMBER() OVER (PARTITION BY wo.id ORDER BY ep.employee_id) = 1 THEN rc_wc.hours_per_day ELSE 0.0 END -- rc_wc.hours_per_day = daily available hours from workcenter resource_calendar -- Only first employee row per WO carries the calendar hours
DescriptionMachine's total available hours per day per its resource calendar. Used as the denominator for machine utilization.
machine_utilization_pct Machine Utilization Percentage โ€” ROW_NUMBER Guard
Calculated
โ–ผ
Formula
CASE WHEN ROW_NUMBER() OVER (PARTITION BY wo.id ORDER BY ep.employee_id) = 1 AND COALESCE(rc_wc.hours_per_day, 0) > 0 THEN ((wo.total_actual_workcenter_time / 60.0) / rc_wc.hours_per_day) * 100.0 ELSE 0.0 END -- Numerator: wo.total_actual_workcenter_time / 60 = machine hours used -- Denominator: rc_wc.hours_per_day = calendar available hours -- ร— 100 = percentage
Interpretation100% = machine ran the entire available shift. Measures scheduling vs actual runtime.
๐Ÿ“ˆ

Overall Equipment Effectiveness (OEE) Fields

OEE = Availability ร— Performance ร— Quality

โ„น๏ธ
OEE is the industry-standard manufacturing KPI. These fields provide the three OEE components and the combined score. Note: These fields are NOT protected by ROW_NUMBER guards โ€” they appear on every employee row. Aggregate with caution: use MAX or take first-employee-row filtering in Power BI measures.
ideal_cycle_time Manual Ideal Cycle Time from Routing (minutes per unit)
OEE
โ–ผ
Source Tablemrp_routing_workcenter (rw)
Source Columnrw.time_cycle_manual
Joinrw.id = wo.operation_id (LEFT JOIN)
Formula
COALESCE(rw.time_cycle_manual, 0.0) -- time_cycle_manual = manually defined cycle time on the routing operation -- Used in OEE Performance calculation -- COALESCE defaults to 0 when not set
DescriptionThe designed/ideal minutes per unit as defined on the routing. Represents the theoretical maximum speed of the operation.
availability_pct OEE Availability Component (%)
Calculated
โ–ผ
Formula
CASE WHEN COALESCE(wo.duration_expected, 0) > 0 THEN (wo.total_actual_workcenter_time / wo.duration_expected) * 100.0 ELSE 100.0 END -- Numerator: wo.total_actual_workcenter_time = actual machine runtime (minutes) -- Denominator: wo.duration_expected = planned runtime (minutes) -- Defaults to 100% when no planned time set (not penalised) -- OEE standard: (Run Time / Planned Production Time) ร— 100
OEE RoleMeasures what fraction of the planned production time the machine was actually running. Losses = unplanned stops, breakdowns.
performance_pct OEE Performance Component (%)
Calculated
โ–ผ
Formula
CASE WHEN COALESCE(wo.total_actual_workcenter_time, 0.0) > 0 THEN ( (COALESCE(rw.time_cycle_manual, 0.0) * COALESCE(eo.quantity_produced, 0.0)) / wo.total_actual_workcenter_time ) * 100.0 ELSE 100.0 END -- Numerator: ideal_cycle_time ร— units_produced -- = theoretical time that should have been needed -- Denominator: wo.total_actual_workcenter_time (actual time used) -- rw.time_cycle_manual = ideal cycle time per unit (mrp_routing_workcenter) -- eo.quantity_produced = done units by this employee (employee_output CTE) -- OEE standard: (Ideal Cycle Time ร— Total Count) / Run Time ร— 100
OEE RoleMeasures running speed vs ideal speed. Losses = slow cycles, minor stops. 100% = machine ran at designed speed throughout.
quality_pct OEE Quality Component (%) โ€” Currently Fixed at 100%
OEE
โ–ผ
Formula
CASE WHEN COALESCE(wo_output.estimated_units, 0.0) > 0 THEN (wo_output.estimated_units / wo_output.estimated_units) * 100.0 ELSE 100.0 END -- (estimated_units / estimated_units) always = 1.0 โ†’ 100% -- Assumption: all produced units are good (no defects tracked yet) -- When a defect/scrap count becomes available, replace denominator -- with total_units_produced (good + defective)
OEE RoleCurrently assumes all output is defect-free (Good Units = Total Units). This field should be updated once defect/rework tracking is implemented in Odoo.
oee_pct Overall OEE Score โ€” Availability ร— Performance ร— Quality ร— 100
Calculated
โ–ผ
Formula
( -- Availability ratio: (CASE WHEN COALESCE(wo.duration_expected, 0) > 0 THEN wo.total_actual_workcenter_time / wo.duration_expected ELSE 1.0 END) * -- Performance ratio: (CASE WHEN COALESCE(wo.total_actual_workcenter_time, 0.0) > 0 THEN (COALESCE(rw.time_cycle_manual, 0.0) * COALESCE(eo.quantity_produced, 0.0)) / wo.total_actual_workcenter_time ELSE 1.0 END) * -- Quality ratio: (CASE WHEN COALESCE(wo_output.estimated_units, 0.0) > 0 THEN wo_output.estimated_units / wo_output.estimated_units ELSE 1.0 END) ) * 100.0 -- Each component defaults to 1.0 (100%) when its denominator is 0 -- Final result: A ร— P ร— Q ร— 100 = OEE percentage -- Industry benchmark: World-class OEE โ‰ฅ 85%
Interpretation85%+ = World-class. 60โ€“85% = Typical. <60% = Significant losses. Since quality is always 100%, OEE effectively equals Availability ร— Performance here.
๐Ÿ—‚๏ธ

Full Column Quick Reference

All 34 output columns at a glance

#AliasTypeSectionSource / Formula Summary
1employee_nameVARCHARDimensionemp.name (hr_employee)
2workorder_nameVARCHARDimensionwo.name (mrp_workorder)
3mo_nameVARCHARDimensionmp.name (mrp_production)
4workcenter_nameVARCHARDimensionwc.name (mrp_workcenter)
5product_nameVARCHARDimension / Calcpt.name->>'en_US' โ€” product resolved via COALESCE(wo_output.product_id, mp.product_id)
6province_codeVARCHARFilterpp.province_code (custom)
7product_formatVARCHARFilterpf.name (custom table)
8src_typeVARCHARFilterst.name (custom via product_category)
9src_categoryVARCHARFiltersc.name (custom via product_category)
10lot_nameVARCHARFilter / CalcSTRING_AGG(DISTINCT COALESCE(sml.lot_name, lot.name), ', ') โ€” from CTE 3
11mo_creation_dateTIMESTAMPTZFiltermp.create_date
12quantity_producedNUMERICEmployee KPICOALESCE(eo.quantity_produced, 0) โ€” from CTE 4 (done output logs)
13weight_producedNUMERICEmployee KPICOALESCE(eo.weight_produced, 0) โ€” from CTE 4
14employee_working_minutesNUMERICEmployee KPIep.employee_working_minutes โ€” SUM(wp.duration) from CTE 1
15employee_working_hoursNUMERICEmployee KPIep.employee_working_minutes / 60.0
16units_per_employee_per_hourNUMERICEmployee KPICASE: quantity_produced / (emp_minutes/60) ELSE NULL
17standard_timeNUMERICEmployee KPIwo.duration_expected (minutes)
18actual_timeNUMERICEmployee KPIwo.total_actual_workcenter_time (minutes)
19employee_efficiency_pctNUMERICEmployee KPICASE: (duration_expected / emp_working_minutes) ร— 100 ELSE NULL
20total_available_labour_timeNUMERICEmployee KPIrc_emp.hours_per_day โ€” COALESCE(ep.calendar, res.calendar, wc.calendar)
21labour_utilization_pctNUMERICEmployee KPICASE: (emp_hours / rc_emp.hours_per_day) ร— 100 ELSE NULL
22attendance_to_output_ratioNUMERICEmployee KPICOALESCE(quantity_produced, 0) / 6.0
23workcenterVARCHARWC Dimensionwc.name (duplicate alias)
24manufacturing_orderVARCHARWC Dimensionmp.name (duplicate alias)
25work_orderVARCHARWC Dimensionwo.name (duplicate alias)
26productVARCHARWC Dimensionpt.name->>'en_US' (duplicate alias)
27workcenter_quantity_producedNUMERICWC KPICASE ROW=1: wo_output.estimated_units ELSE 0 โ€” ROW_NUMBER dedup guard
28runtime_minutesNUMERICWC KPICASE ROW=1: wo.total_actual_workcenter_time ELSE 0 โ€” ROW_NUMBER guard
29planned_runtimeNUMERICWC KPICASE: duration_expected / wec.employee_count ELSE 0
30workcenter_efficiency_pctNUMERICWC KPICASE ROW=1 AND actual>0: (duration_expected/actual_time)ร—100 ELSE 0
31units_per_minuteNUMERICWC KPICASE ROW=1 AND actual>0: estimated_units/actual_time ELSE 0
32units_per_hourNUMERICWC KPICASE ROW=1 AND actual>0: estimated_units/(actual_time/60) ELSE 0
33total_available_machine_timeNUMERICWC KPICASE ROW=1: rc_wc.hours_per_day ELSE 0
34machine_utilization_pctNUMERICWC KPICASE ROW=1 AND cal>0: (actual_hours/rc_wc.hours_per_day)ร—100 ELSE 0
35ideal_cycle_timeNUMERICOEECOALESCE(rw.time_cycle_manual, 0) โ€” mrp_routing_workcenter
36availability_pctNUMERICOEECASE: (actual_time/duration_expected)ร—100 ELSE 100
37performance_pctNUMERICOEECASE: (ideal_cycle_time ร— qty / actual_time)ร—100 ELSE 100
38quality_pctNUMERICOEECASE: (units/units)ร—100 = 100% always (no defect data yet)
39oee_pctNUMERICOEEAvailability_ratio ร— Performance_ratio ร— Quality_ratio ร— 100