I aggregate temperature values by monthly windows like this:
import "date"
dataSet = from(bucket: "rtl_433")
|> range(start: -1y, stop: date.truncate(t: now(), unit: 1mo))
// |> range(start: 2022-07-01T00:00:00Z, stop: 2022-07-31T00:00:00Z)
|> filter(fn: (r) => r._measurement == "Nexus-T")
|> filter(fn: (r) => r._field == "temperature_C")
|> filter(fn: (r) => r.channel == "2")
dataSet
|> aggregateWindow(every: 1mo, fn: mean, createEmpty: false)
The resulting data is always shifted by one month, e.g. values cumulated for July 22 are displayed as “08/01” (1st of August).
I would like to have them shown as “07/01”.
Does anybody know how to achieve this?