Hi,
I have a problem with making an annual summary of energy consumption broken down into individual months (January to December).
I wrote this query in Flux:
from(bucket: "dom/autogen") |> range(start: 2020-01-01T00:00:00Z, stop: 2021-01-01T00:00:00Z) |> filter(fn: (r) => r._measurement == "impulsy") |> filter(fn: (r) => r._field == "impuls") |> filter(fn: (r) => r.licznik == "prad") |> aggregateWindow(every: 1mo, fn: sum) |> map(fn: (r) => ({ r with _value: r._value / 1000.0 * 0.5386 })) |> yield(name: "prad")
The data is downloaded correctly from the database, but!
- January energy consumption is summed up with the date February 1 2020
- February consumption is added together with March 1, 2020
- December consumption is summed up with the date January 1 2021
Grafana, on the other hand, tries to display bars from January to December.
For this reason, the last bar does not appear on the chart at all.
I will be grateful for your help!
Best ragards from Poland!
Luke