Hi
I need help converting a query from QL to Flux. It works in QL fine, but I want to group by month which Flux can do well.
The query basically gives me a time (in minutes) the power was above a certain value (in this case, 320W)
QL:
SELECT count(“value”) / 6 FROM “one_year”.“heating_ppnorth” WHERE (“value” > 320) AND $timeFilter GROUP BY time(30d) fill(null) tz(‘Pacific/Auckland’)
I end up getting results via QL like this:
2022-06-26 00:00:00 1.83 hour
2022-06-27 00:00:00 4.05 hour
2022-06-28 00:00:00 3.12 hour
2022-06-29 00:00:00 1.21 hour
The underlying data provides power consumption in watts, written to InfluxDB every 10 seconds. The query above will count every minute it’s running above the threshold and I’ve got a transformation on the chart which will Total each day.