Trying to make the jump from InfluxQL to Flux, and need a little help.
In InfluxQL, we put the two orange lines on the graph in Grafana using math(1.025)
and math(0.975)
as separate queries:
SELECT mean("HTFN8FRSP") *.975 FROM "stations" WHERE $timeFilter GROUP BY time(1m) fill(null)
In Flux, here is a mock-up query. I have tried adding or multiplying values to the Setpoint (e.g. + 3), but no success. Am sure it’s something simple that I am missing.
from(bucket: "bucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["tag1"] == "sensor1")
|> filter(fn: (r) => r["_field"] == "actualValue" or r["_field"] == "setpointValue")
|> filter(fn: (r) => r["_measurement"] == "measurement")
|> aggregateWindow(every: 5s, fn: last, createEmpty: false)
|> yield(name: "last")