# Compute substraction of count with Visual builder

**URL:** <https://discuss.elastic.co/t/compute-substraction-of-count-with-visual-builder/198379>\
**Category:** Kibana\
**Created:** [September 6, 2019, 8:59am UTC](https://discuss.elastic.co/t/compute-substraction-of-count-with-visual-builder/198379 "2019-09-06T08:59:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dtu](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dtu](https://discuss.elastic.co/u/dtu)\
**Post date:** [September 6, 2019, 8:59am UTC](https://discuss.elastic.co/t/compute-substraction-of-count-with-visual-builder/198379/1 "2019-09-06T08:59:41Z")

</div>

Hi,  
I'd like to know how I can compute the substraction between 2 results of count in visualbuilder.  
For each count, we've got a different filter.  
I'd like to obatin the difference between total and nb OK. Is it possible to realize it?

 ![kibana_visual](https://us1.discourse-cdn.com/elastic/original/3X/8/a/8a708e158e2f9260345c7721a323b16badf9cb5c.jpeg)

---

<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:** [September 13, 2019, 10:46am UTC](https://discuss.elastic.co/t/compute-substraction-of-count-with-visual-builder/198379/2 "2019-09-13T10:46:35Z")

</div>

Add a math aggregation and follow the instruction the config there and you can do subtractions with it.

---

<div class="post-metadata">

**Author:** ![dtu](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dtu](https://discuss.elastic.co/u/dtu)\
**Post date:** [September 23, 2019, 11:52am UTC](https://discuss.elastic.co/t/compute-substraction-of-count-with-visual-builder/198379/3 "2019-09-23T11:52:15Z")

</div>

Sorry but I don't understand how to do it because here, i've got 2 different series, my count is not on the same serie so how can I do ? I can't do a math aggregation ... Thks.

---

<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:** [October 21, 2019, 11:52am UTC](https://discuss.elastic.co/t/compute-substraction-of-count-with-visual-builder/198379/4 "2019-10-21T11:52:17Z")

</div>

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