influxdata / flux

Flux is a lightweight scripting language for querying databases (like InfluxDB) and working with data. It's part of InfluxDB 1.7 and 2.0, but can be run independently of those.

Home Page:https://influxdata.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

oee.APQ: internal error: panic: unknown type invalid

Basbosbaas opened this issue · comments

First of all, its great that this package exists!

But when I use it I get the folowing errorcode: internal error: panic: unknown type invalid

What I want is to window the data per hour and calculate the OEE per hour.
But when I have just one row in a table after the |> group(columns: ["_start", "_stop"]) I get this error.
This is my whole query:

import "experimental/oee"
from(bucket: "TestOee2")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "Status")
|> window(every: 1h)
|> group(columns: ["_start", "_stop"])
|> map(fn: (r) => ({ r with partCount: float(v: r.Productienummer)}))
|> map(fn: (r) => ({ r with badCount: 1}))
|> map(fn: (r) => ({ r with state: r._value}))
|> keep(columns: ["_start", "_stop", "_time", "badCount", "partCount", "state"])
|> group(columns: ["_start", "_stop"])
|> oee.APQ(runningState: 20.0, plannedTime: 1h, idealCycleTime: 120s )
|> group()

This issue has had no recent activity and will be closed soon.