How to filter out data if "_value" is a string [Flux] [InfluxDB]

Viewed 944

Among my data, there are a couple strings in the "_value" column. This means that when I use aggregateWindow() I get this error: unsupported input type for mean aggregate: string.

I want to know how I can filter out data of type string, before passing to aggregateWindow, thus avoiding the error.

Something like this maybe:

from(bucket: "mybucket")
  |> range(start: -10m, stop: now())
  |> filter(fn: (r) => type(r["_value"]) != "string")
  |> aggregateWindow(every: 1m, fn: mean, createEmpty: false)
  |> yield(name: "mean")
0 Answers
Related