Hi,
I’m trying to get monthly aggregations from values I record about every second. Unfortunately I’m struggling to get the query working correctly.
I tried:
from(bucket: "mybucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "mymeasurement")
|> filter(fn: (r) => r["_field"] == "myvalue")
|> aggregateWindow(every: 1mo, fn: min)
I expected to get a result table with one entry for every month and a value from the beginning of the month (as I use the min function and the value is constantly growing as it is a meter reading).
Infact I get the following (shortened to the relevant columns):
_time _value
2021-11-01T00:00:00Z 1361045.9416 # (that's a value from the end of September/beginning of oktober --> one month wrong)
2021-12-01T00:00:00Z 1431051.4897 # (that's a value from the end of October/beginning of November -> again one month wrong)
2022-01-01T00:00:00Z 1651448.4397 # (same here...)
2022-01-01T22:59:59Z 1935557.5113
All _time values are wrong by one month. Why does this happen?
Thanks