# aggregateWindow with create empty

**URL:** <https://community.influxdata.com/t/aggregatewindow-with-create-empty/17559>\
**Category:** Fluxlang\
**Tags:** influxdb, flux\
**Created:** [January 10, 2021, 7:35pm UTC](https://community.influxdata.com/t/aggregatewindow-with-create-empty/17559 "2021-01-10T19:35:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kostyan5](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/kostyan5/32/6385_2.png) [@kostyan5](https://community.influxdata.com/u/kostyan5)\
**Post date:** [January 10, 2021, 7:35pm UTC](https://community.influxdata.com/t/aggregatewindow-with-create-empty/17559/1 "2021-01-10T19:35:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![MzazM](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@MzazM](https://community.influxdata.com/u/MzazM)\
**Post date:** [January 13, 2021, 12:33pm UTC](https://community.influxdata.com/t/aggregatewindow-with-create-empty/17559/2 "2021-01-13T12:33:31Z")

</div>

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
