# How get average agregation without negative value in field

**URL:** <https://discuss.elastic.co/t/how-get-average-agregation-without-negative-value-in-field/232299>\
**Category:** Kibana\
**Created:** [May 12, 2020, 6:35pm UTC](https://discuss.elastic.co/t/how-get-average-agregation-without-negative-value-in-field/232299 "2020-05-12T18:35:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![111334](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111334/32/45618_2.png) [@111334](https://discuss.elastic.co/u/111334)\
**Post date:** [May 12, 2020, 6:35pm UTC](https://discuss.elastic.co/t/how-get-average-agregation-without-negative-value-in-field/232299/1 "2020-05-12T18:35:42Z")

</div>

Tell me how to exclude negative values ​​from aggregation?

---

<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:** [May 12, 2020, 9:01pm UTC](https://discuss.elastic.co/t/how-get-average-agregation-without-negative-value-in-field/232299/2 "2020-05-12T21:01:07Z")

</div>

you can use a global filter to exclude negatives. See [https://www.elastic.co/guide/en/kibana/current/filters.html](https://www.elastic.co/guide/en/kibana/current/filters.html) for details

---

<div class="post-metadata">

**Author:** ![111334](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111334/32/45618_2.png) [@111334](https://discuss.elastic.co/u/111334)\
**Post date:** [May 13, 2020, 7:02am UTC](https://discuss.elastic.co/t/how-get-average-agregation-without-negative-value-in-field/232299/3 "2020-05-13T07:02:58Z")

</div>

no, this is hardly suitable for me, I have a visualization - a data table, I need to do an average aggregation by a certain field in the index, but exclude negative values ​​from the aggregation, how can I do this?

---

<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:** [June 10, 2020, 7:03am UTC](https://discuss.elastic.co/t/how-get-average-agregation-without-negative-value-in-field/232299/4 "2020-06-10T07:03:06Z")

</div>

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