# Filter on SUM?

**URL:** https://discuss.elastic.co/t/filter-on-sum/162097
**Category:** Kibana
**Created:** [December 26, 2018, 6:10am UTC](https://discuss.elastic.co/t/filter-on-sum/162097 "2018-12-26T06:10:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Sjaak01](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sjaak01](https://discuss.elastic.co/u/Sjaak01)
#### Post date: [December 26, 2018, 6:10am UTC](https://discuss.elastic.co/t/filter-on-sum/162097/1 "2018-12-26T06:10:11Z")

</div>

Hi,

I was wondering whether its possible to create a filter a query dsl to filter values where the SUM of a field exceeds X?

If have a bar graph that sums bytes as a metric and a bucket term on a location field so I get the total bytes per location.

However I want to graph only the locations where the SUM of bytes for that particular location exceeds e.g 1GB.

The usual tricks I know don't work because it needs to be applied to the SUM.

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [December 27, 2018, 10:28am UTC](https://discuss.elastic.co/t/filter-on-sum/162097/2 "2018-12-27T10:28:11Z")

</div>

There isn't really a way to apply a filter for an aggregation, but you can do something like there where you only show bars for the terms that go above your threshold (by setting a min for the Axis extent):  
 ![axis_extents](https://us1.discourse-cdn.com/elastic/original/3X/c/1/c128fd71ecdae03efe02f40e07814588ca4640d6.png)

---

<div class="post-metadata">

### Author: ![Sjaak01](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sjaak01](https://discuss.elastic.co/u/Sjaak01)
#### Post date: [December 27, 2018, 11:48pm UTC](https://discuss.elastic.co/t/filter-on-sum/162097/3 "2018-12-27T23:48:31Z")

</div>

Thanks but it doesn't hide the actual term so in my case that will cause a lot of clutter. Also it doesn't seem to work very reliably on 6.5. Putting the the raw byte value sometime a bar is hidden, sometimes not.

Maybe using Watcher to get the SUM and write that to an index to visualize on is a better solution.

---

<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: [January 24, 2019, 11:48pm UTC](https://discuss.elastic.co/t/filter-on-sum/162097/4 "2019-01-24T23:48:39Z")

</div>

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