# \[SOLVED\] Metric: Count versus Term

**URL:** <https://discuss.elastic.co/t/solved-metric-count-versus-term/71970>\
**Category:** Kibana\
**Created:** [January 18, 2017, 10:02am UTC](https://discuss.elastic.co/t/solved-metric-count-versus-term/71970 "2017-01-18T10:02:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![axelfelix](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@axelfelix](https://discuss.elastic.co/u/axelfelix)\
**Post date:** [January 18, 2017, 10:02am UTC](https://discuss.elastic.co/t/solved-metric-count-versus-term/71970/1 "2017-01-18T10:02:42Z")

</div>

Hi all,

I make some visualization in Kibana and i'm not sure to understand the difference between "Metric: Count" and "Term" for a sub-aggregation in the "Order By" part.

I get different results if I try one or the other. But I can't explain.

For me the "Metric: Count" counts the number of documents returned. But I can't explain the other... 😕

Thanks for your help,  
Alex

---

<div class="post-metadata">

**Author:** ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)\
**Post date:** [January 18, 2017, 5:29pm UTC](https://discuss.elastic.co/t/solved-metric-count-versus-term/71970/2 "2017-01-18T17:29:41Z")

</div>

Hi Alexandre,

Yes, the "Order By" is affecting your results because of the Size field below that. So if you order by "Metric: Count" you get the top "size" results back based on the Count.  
But if you can that to order by the Term (uses the field of that sub aggregation) then you get the top "size" results back of that term.

Regards,  
Lee

---

<div class="post-metadata">

**Author:** ![axelfelix](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@axelfelix](https://discuss.elastic.co/u/axelfelix)\
**Post date:** [January 20, 2017, 12:34pm UTC](https://discuss.elastic.co/t/solved-metric-count-versus-term/71970/3 "2017-01-20T12:34:09Z")

</div>

Thanks for your reply.

May be it's a translation issue but I'm not sure to understand.

**"Metric: Count"** represent the number of documents returns ?  
**"Term"** represent the number of documents matching some criteria ? For exemple "field:storm\*"

Thanks,  
Alex

---

<div class="post-metadata">

**Author:** ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)\
**Post date:** [January 20, 2017, 3:20pm UTC](https://discuss.elastic.co/t/solved-metric-count-versus-term/71970/4 "2017-01-20T15:20:41Z")

</div>

In this visualization the Y-Axis is showing the Count of documents  
and the x-axis is showing the top 20 terms in the `name` field.  
And `Order By: metric: Count` shows Chrome first in the chart because it has the highest Count.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/1/13512af184501a16e81b8a445ee4f32c26cdcfdd.png)

If I change my Y-Axis to `Max bytes` then that Order By choice changes to `metric: Max bytes`

 ![](https://us1.discourse-cdn.com/elastic/original/2X/4/478e22c613c24c686dd769a69a93ce53077f070a.png)

Or I can leave the Y-Axis on Max bytes, and just change the Order By to `Term`. So now it's showing me the top 20 terms in order, and the Max bytes of each of them. Chrome starts with `C` and is still in that list, but Firefox isn't in the top 20 of the `name` field. So yes, it makes it return different data. If there were less than 20 terms for this field I think you would get the same results but only in a different order.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/3/318826524db58811afdb6e132a46e5e920e163d9.png)

---

<div class="post-metadata">

**Author:** ![axelfelix](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@axelfelix](https://discuss.elastic.co/u/axelfelix)\
**Post date:** [January 20, 2017, 10:00pm UTC](https://discuss.elastic.co/t/solved-metric-count-versus-term/71970/5 "2017-01-20T22:00:23Z")

</div>

Thanks a lot LeeDr for this clear explanation !

Have a nice day,  
Alex

---

<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 17, 2017, 10:00pm UTC](https://discuss.elastic.co/t/solved-metric-count-versus-term/71970/6 "2017-02-17T22:00:32Z")

</div>

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