# Treatment of missing data for moving average of sum metric

**URL:** <https://discuss.elastic.co/t/treatment-of-missing-data-for-moving-average-of-sum-metric/118442>\
**Category:** Kibana\
**Created:** [February 5, 2018, 12:29pm UTC](https://discuss.elastic.co/t/treatment-of-missing-data-for-moving-average-of-sum-metric/118442 "2018-02-05T12:29:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![g4lvanix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/g4lvanix/32/27370_2.png) [@g4lvanix](https://discuss.elastic.co/u/g4lvanix)\
**Post date:** [February 5, 2018, 12:29pm UTC](https://discuss.elastic.co/t/treatment-of-missing-data-for-moving-average-of-sum-metric/118442/1 "2018-02-05T12:29:10Z")

</div>

Hello!

I am currently trying to create a histogram plot of some data. I have added a filter that will remove some documents that I don't want to show up in the results. This is working fine and the corresponding bins are empty.

After that I have added a new metric which is the sum of a field for all documents in a given bucket.  
The bins that I excluded (via another field name so they are empty bins) are not shown. It is showing what I want.

Now when I add a new moving average aggregation on the sum aggregation all of a sudden the empty show up again and their values are set to zero. I would prefer if those zero values would not show up in the histogram.

I have tried adding the parameter "gap\_policy":"skip" but alas that doesn't help, neither on the sum aggregation or the moving average aggregation.

In the histogram I can also not change the "show empty bins" check box.

Does the moving average aggregation assume empty bins to be zero when applying it to another aggregation? Is there a way to fix this?

Thank you!  
g4lvanix

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [February 5, 2018, 7:40pm UTC](https://discuss.elastic.co/t/treatment-of-missing-data-for-moving-average-of-sum-metric/118442/2 "2018-02-05T19:40:45Z")

</div>

Hi ,

I have asked @thomasneirynck to take a look as I didn't want to give you a half baked answer. Please wait for this to be answered. Thank you

Rashmi

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [February 7, 2018, 1:48am UTC](https://discuss.elastic.co/t/treatment-of-missing-data-for-moving-average-of-sum-metric/118442/3 "2018-02-07T01:48:25Z")

</div>

hi @g4lvanix,

Could you attach a few screenshots of your configuration and how the chart looks like?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 7, 2018, 1:48am UTC](https://discuss.elastic.co/t/treatment-of-missing-data-for-moving-average-of-sum-metric/118442/4 "2018-03-07T01:48:30Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
