# Count of unique events

**URL:** <https://discuss.elastic.co/t/count-of-unique-events/265037>\
**Category:** Elasticsearch\
**Created:** [February 22, 2021, 7:57am UTC](https://discuss.elastic.co/t/count-of-unique-events/265037 "2021-02-22T07:57:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![artobstrel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artobstrel/32/16874_2.png) [@artobstrel](https://discuss.elastic.co/u/artobstrel)\
**Post date:** [February 22, 2021, 7:57am UTC](https://discuss.elastic.co/t/count-of-unique-events/265037/1 "2021-02-22T07:57:42Z")

</div>

I have 5000 unique events. If I try to unique count with default precision value, I get the wrong value:

![prec](https://us1.discourse-cdn.com/elastic/original/3X/4/9/495993660e79d743886e98c6a36b24e102beff42.png)

How can I calculate truly unique values without changing the precision?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 22, 2021, 10:51am UTC](https://discuss.elastic.co/t/count-of-unique-events/265037/2 "2021-02-22T10:51:08Z")

</div>

Cardinality aggregations and some other types of aggregations [are always approximations](https://www.elastic.co/guide/en/elasticsearch/reference/7.11/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate). Even though you can tune the threshold they are never going to be guaranteed to be exact.

---

<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:** [March 22, 2021, 10:51am UTC](https://discuss.elastic.co/t/count-of-unique-events/265037/3 "2021-03-22T10:51:39Z")

</div>

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