# Doing Math with count of fields

**URL:** <https://discuss.elastic.co/t/doing-math-with-count-of-fields/164096>\
**Category:** Kibana\
**Created:** [January 14, 2019, 7:25am UTC](https://discuss.elastic.co/t/doing-math-with-count-of-fields/164096 "2019-01-14T07:25:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vac](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@Vac](https://discuss.elastic.co/u/Vac)\
**Post date:** [January 14, 2019, 7:25am UTC](https://discuss.elastic.co/t/doing-math-with-count-of-fields/164096/1 "2019-01-14T07:25:35Z")

</div>

Would it be possible to perform a math operation in a Visual Builder Table with counts of a specific field?

For example: Based on the count value of the messages with two different matched query/filter (i.e count of all message with 'Query' as its matched query/filter for one count, and 'Result' as its other matched query/filter for another count, I want to find the remainder from subtracting one overall count over another overall count.

If so, how?

---

<div class="post-metadata">

**Author:** ![Vac](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@Vac](https://discuss.elastic.co/u/Vac)\
**Post date:** [January 18, 2019, 1:36am UTC](https://discuss.elastic.co/t/doing-math-with-count-of-fields/164096/2 "2019-01-18T01:36:30Z")

</div>

No response?

---

<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:** [January 21, 2019, 4:07pm UTC](https://discuss.elastic.co/t/doing-math-with-count-of-fields/164096/3 "2019-01-21T16:07:59Z")

</div>

I don't really understand what you're asking there, are you talking about a difference in count between the fields that have "Query" and one that have "Result" ?

---

<div class="post-metadata">

**Author:** ![Vac](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@Vac](https://discuss.elastic.co/u/Vac)\
**Post date:** [January 22, 2019, 1:38am UTC](https://discuss.elastic.co/t/doing-math-with-count-of-fields/164096/4 "2019-01-22T01:38:46Z")

</div>

Something like that, but I am trying to find the difference between two counts of different queries on one field.

---

<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:** [February 19, 2019, 1:38am UTC](https://discuss.elastic.co/t/doing-math-with-count-of-fields/164096/5 "2019-02-19T01:38:50Z")

</div>

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