oee.APQ() function

The oee.APQ() function is experimental and subject to change at any time. By using this function, you accept the risks of experimental functions.

The oee.APQ() function computes availability, performance, quality (APQ) and overall equipment effectiveness (OEE) in producing parts. Provide the required input schema to ensure this function successfully calculates APQ and OEE.

import "experimental/oee"

  runningState: "running",
  plannedTime: 8h,
  idealCycleTime: 2m

Required input schema

You must include the following columns in your production data input tables:

  • _stop: Right time boundary timestamp (typically assigned by range() or window()).
  • _time: Timestamp of the production event.
  • state: String that represents start or stop events or the production state.
  • partCount: Cumulative total of parts produced.
  • badCount: Cumulative total of parts that do not meet quality standards.

Output schema

For each input table, the oee.APQ function outputs a table with a single row that includes the following columns:

  • _time: Timestamp associated with the APQ calculation.
  • availability: Ratio of time production was in a running state.
  • oee: Overall equipment effectiveness.
  • performance: Ratio of production efficiency.
  • quality: Ratio of production quality.
  • runTime: Total nanoseconds spent in the running state..



(Required) State value that represents a running state.

Data type: String


(Required) Total time that equipment is expected to produce parts.

Data type: Duration | Integer

Integer values represent nanoseconds.


(Required) Ideal minimum time to produce one part.

Data type: Duration | Integer

Integer values represent nanoseconds.


Input data. Default is piped-forward data. See Required input schema.


The following example uses production data (productionData) and oee.APQ() to calculate the APQ and OEE of an eight hour production window.

Input data (productionData)



import "experimental/oee"

productionData = // ...

  |> oee.APQ(
    runningState: "running",
    plannedTime: 8h,
    idealCycleTime: 21s
  |> drop(columns: ["_start","_stop"])

Output data


Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: