Skip to main content

mes.spGetOEEDataByIntervalGroupByItemAndShift

Description

This procedure returns Overall Equipment Effectiveness (OEE) metrics grouped by both item and operational shift for a specified asset over a given time interval. It aligns asset run/downtime with shift windows and aggregates counter data to compute availability, performance, quality, and OEE.

Syntax

mes.spGetOEEDataByIntervalGroupByItemAndShift @assetId, @startDate, @endDate, @interval

Parameters:
@assetId (int): ID of the asset to analyze.
@startDate, @endDate (datetime): Date/time boundaries for analysis.
@interval (varchar): Time granularity for the metrics ('Hour', 'Day', or 'Week').

Returns:
Rows grouped by shift and item with:
- Shift ID and name
- Item metadata (ID, name, units, packaging)
- Duration, runtime, and downtime (planned/unplanned)
- Raw and normalized infeed/outfeed/waste counters
- Computed values: target count, availability, performance, quality, and OEE

Code Example

EXEC mes.spGetOEEDataByIntervalGroupByItemAndShift
@assetId = 3072,
@startDate = '2025-07-01',
@endDate = '2025-07-15',
@interval = 'Day';