# Sum diferentes counts kibana

**URL:** <https://discuss.elastic.co/t/sum-diferentes-counts-kibana/150744>\
**Category:** Elasticsearch\
**Created:** [October 2, 2018, 5:28pm UTC](https://discuss.elastic.co/t/sum-diferentes-counts-kibana/150744 "2018-10-02T17:28:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafaelvicio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafaelvicio/32/36125_2.png) [@rafaelvicio](https://discuss.elastic.co/u/rafaelvicio)\
**Post date:** [October 2, 2018, 5:28pm UTC](https://discuss.elastic.co/t/sum-diferentes-counts-kibana/150744/1 "2018-10-02T17:28:21Z")

</div>

Can I add / subtract counts with different attributes?

count1:

{  
query: {  
match: {  
event\_type: {  
query: icecast  
type: phrase  
}  
}  
}  
}

count2:

{  
query: {  
match: {  
event\_type: {  
query: othericecast  
type: phrase  
}  
}  
}  
}

I want an amount that is the result of count1 - result of count2

---

<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 30, 2018, 5:28pm UTC](https://discuss.elastic.co/t/sum-diferentes-counts-kibana/150744/2 "2018-10-30T17:28:25Z")

</div>

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