I have the following task to resample hourly data to monthly data.
option task = {name: “cny-monthly”, every: 28d}
temp_normal = from(bucket:“noaa”)
|> range(start: 2017-01-01T00:00:00Z, stop: 2020-12-25T00:00:00Z)
|> filter(fn: (r ) => r._measurement == “hourly_cny” and r._field == “temp_normal”)
|> aggregateWindow(column: “_value”, every: 1mo, fn: mean)
temp_normal
|> filter(fn: (r ) => exists r._value )
|> set(key: “_measurement”, value: “monthly_cny”)
|> to(bucket: “noaa”)
The task was ran successfully executed. However, when I ran this query:
from(bucket: “noaa”)
|> range(start: 2018-03-01T00:00:00Z)
|> filter(fn: (r ) => r._measurement == “monthly_cny”)
only data point from 2018-02-28 is returned.
My hourly data starts from 2018-01-01T00:00:00Z
and ends at 2018-12-31T23:00:00Z
. It seems to me that hourly data got resampled successfully into monthly data and is written into monthly_cny
measurement but querying from monthly_cny
only returns one month at a time instead of all the other monthly data with _time
greater than start
in the query.
Query result for monthly data:
My influxdb version is 2.0.0