Anyone having experience with Flux willing/able to help out?
Looking to convert an Influx query to a Flux query for a Grafana power consumption panel...
Influx query works fine for everything at day or hour level but wont do month or year ...
This query takes all datapoints in the timerange and averages them over 1 minute. It then sums them up (divided by 60 to get hour values) grouped whatever reporting period is desired.
InfluxQL can't do 1mo/1y grouping here unfortunately...
Flux can do it but I have not the slightest idea how to use it
Looking to convert an Influx query to a Flux query for a Grafana power consumption panel...
Influx query works fine for everything at day or hour level but wont do month or year ...
Code:
SELECT SUM("power"::float) / (60.0 )
FROM (
SELECT mean("value") AS power FROM "mydatapoint" WHERE $timeFilter GROUP BY time(1m) tz('Europe/Berlin')
)
GROUP BY time(30d) tz('Europe/Berlin')
InfluxQL can't do 1mo/1y grouping here unfortunately...
[feature request] Support month and year as duration unit · Issue #3991 · influxdata/influxdb
For example: 1M for 1 month 1y for 1 year Its useful for me when i want to query the data last month and year...
github.com
Flux can do it but I have not the slightest idea how to use it