aggregateWindow with create empty

aggregateWindow with create empty seems to behave differently based on the aggregate function.

For example, I have a measurement with one data point on 12/15. And I would like a flux query that would aggregate by day and if there is no data for that day, to fill with null. If I use “mean” as aggregate function, it behaves as expected, and I get empty windows after 12/15 to present.

|> aggregateWindow(every: 1d, fn: mean, createEmpty: true)

However, if I use “last” as aggregate, I do not get any empty windows. Only the window with the data point. Same behavior is observed for “min” and “max” aggregate.

|> aggregateWindow(every: 1d, fn: last, createEmpty: true)

This is unexpected. Is this a bug or is there a reason for this?

2 Likes

Hello, I do not have an answer but I can confirm that I noted the same. I asked in slack #flux channel on 17th dec 2020, but I got no answer