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.
https://influxdata.com
MIT License
760 stars 152 forks source link

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

Closed Basbosbaas closed 1 year ago

Basbosbaas commented 1 year ago

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()

github-actions[bot] commented 1 year ago

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