I’m using continuous queries to downsample a power measurement. My query looks like this:
CREATE CONTINUOUS QUERY 5m_power ON balancing RESAMPLE EVERY 5m FOR 1h BEGIN SELECT mean(filled) AS value INTO power_m FROM (SELECT max(value) AS filled FROM balancing WHERE "tag" =~ /Power*/ GROUP BY *, time(1s) fill(previous)) GROUP BY *, time(5m) END
I assume a ‘fill previous’ strategy for the whole data. But it happens that the first 5m bucket of the 1h boundary is wrong, since it is missing the last value from before the boundary to be filled within the first 5m bucket.
To avoid this problem I would like to change the query e.g. in a way that it resamples 1h but only writes the last 55 minutes back INTO power_m, but didn’t find a way that worked.
Any ideas welcome. Thanks in advance, Sebastian