# Irregular behaviour between "Count", "Sum" and "Unique Count" aggregations

**URL:** <https://discuss.elastic.co/t/irregular-behaviour-between-count-sum-and-unique-count-aggregations/23816>\
**Category:** Kibana\
**Created:** [June 17, 2015, 8:55am UTC](https://discuss.elastic.co/t/irregular-behaviour-between-count-sum-and-unique-count-aggregations/23816 "2015-06-17T08:55:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sqpdln](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sqpdln/32/644_2.png) [@sqpdln](https://discuss.elastic.co/u/sqpdln)\
**Post date:** [June 17, 2015, 8:55am UTC](https://discuss.elastic.co/t/irregular-behaviour-between-count-sum-and-unique-count-aggregations/23816/1 "2015-06-17T08:55:58Z")

</div>

I have a bar chart where I plot the _Count_ of documents, with a fixed interval of one minute. I have noticed that when the interval is scaled due to too many buckets, it keeps the x-axis label "timestamp per minute", and that it behind the scenes divides the count by the number of minutes in the new interval. This also happens with a _Sum_ aggregation.

When doing the same with _Unique Count_, this does not happen, and the x axis label changes to the new interval, e.g "timestamp per 3 hours". I find this unintuitive and undocumented.

I think that this feature should be enabled/disabled with a checkbox, both for Count, Sum and Unique Count. It's a great feature. My use case is that I use Unique Count to plot concurrent sessions. This breaks when the interval scales up, since the bars show the total of the entire interval, and not the average. It would be great if it could calculate an average as with Sum and Count.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 18, 2015, 4:42am UTC](https://discuss.elastic.co/t/irregular-behaviour-between-count-sum-and-unique-count-aggregations/23816/2 "2015-06-18T04:42:00Z")

</div>

This would probably be better off as an issue on GH, the dev team may otherwise miss it here 🙂

---

<div class="post-metadata">

**Author:** ![sqpdln](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sqpdln/32/644_2.png) [@sqpdln](https://discuss.elastic.co/u/sqpdln)\
**Post date:** [June 18, 2015, 5:46am UTC](https://discuss.elastic.co/t/irregular-behaviour-between-count-sum-and-unique-count-aggregations/23816/3 "2015-06-18T05:46:15Z")

</div>

Yes, it turned out more like an issue than a question, but actually I wanted to know if this is intentional and what the thoughts behind it is. I'll put it up at GH as well.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 18, 2015, 6:09am UTC](https://discuss.elastic.co/t/irregular-behaviour-between-count-sum-and-unique-count-aggregations/23816/4 "2015-06-18T06:09:34Z")

</div>

Awesome, thanks for that 🙂

---

<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:** [July 6, 2017, 2:17pm UTC](https://discuss.elastic.co/t/irregular-behaviour-between-count-sum-and-unique-count-aggregations/23816/5 "2017-07-06T14:17:52Z")

</div>


