# Explicit Unique Count for Business Intelligence tasks: no chance?

**URL:** <https://discuss.elastic.co/t/explicit-unique-count-for-business-intelligence-tasks-no-chance/118641>\
**Category:** Kibana\
**Created:** [February 6, 2018, 12:30pm UTC](https://discuss.elastic.co/t/explicit-unique-count-for-business-intelligence-tasks-no-chance/118641 "2018-02-06T12:30:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikhail](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mikhail](https://discuss.elastic.co/u/Mikhail)\
**Post date:** [February 6, 2018, 12:30pm UTC](https://discuss.elastic.co/t/explicit-unique-count-for-business-intelligence-tasks-no-chance/118641/1 "2018-02-06T12:30:45Z")

</div>

I have come here from SQL world and have fallen into Unique Count trap called `cardinality`.  
Very disappointed that `unique count` here is not the same as `count distinct` in SQL.  
[https://www.elastic.co/guide/en/elasticsearch/guide/current/cardinality.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/cardinality.html)

Is there any chance to get the **explicit** unique count in Kibana? Any approximations are not acceptable for my task.

Some explanation: I have built SQL data mart with large amount of fields i.e. have joined a lot of SQL entities to get all desired data and all labels in one SQL data mart. And have got some expected multiplication of rows due to the ID of some entity can appear in my mart in different rows. And have transferred these data into one ES index via Logstash. Then, `unique count by ClientID field` in Kibana, comparison with `count (distinct ClientID)` executed on SQL mart, and bad mood for at least the rest of the day as a result.

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [February 7, 2018, 9:52pm UTC](https://discuss.elastic.co/t/explicit-unique-count-for-business-intelligence-tasks-no-chance/118641/2 "2018-02-07T21:52:27Z")

</div>

hi @Mikhail,

imho there's no quick shortcut for this. This limitation is informed by Elasticsearch's distributed architecture and the choice for using the HyperLogLog algorithm to compute the unique count.

I would open an enhancement request in Elasticsearch repo for this: [https://github.com/elastic/elasticsearch/issues/new](https://github.com/elastic/elasticsearch/issues/new)

---

<div class="post-metadata">

**Author:** ![Mikhail](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mikhail](https://discuss.elastic.co/u/Mikhail)\
**Post date:** [February 9, 2018, 9:48am UTC](https://discuss.elastic.co/t/explicit-unique-count-for-business-intelligence-tasks-no-chance/118641/3 "2018-02-09T09:48:05Z")

</div>

hi @thomasneirynck,

Thank you for support on this. I have created feature request there:

> <https://github.com/elastic/elasticsearch/issues/28599>

Hope it will be implemented.

---

<div class="post-metadata">

**Author:** ![Mikhail](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mikhail](https://discuss.elastic.co/u/Mikhail)\
**Post date:** [February 16, 2018, 4:52pm UTC](https://discuss.elastic.co/t/explicit-unique-count-for-business-intelligence-tasks-no-chance/118641/4 "2018-02-16T16:52:12Z")

</div>

So, request for this feature is Closed on github. This will not be implemented.  
This means that if you want to build some BI system using ELK and this system requires explicit counts then IMHO you have three options:

1. Use existing Unique count metric and admit approximation.

2. Organize your source data in the way when you will have no multiplication of the same EntityID within one source data mart where you whant to count unique values. But in that case, what about relations between indicies (joins) on Kibana level? I don't know how to reach this. If someone knows then please suggest.

3. Do not use ELK for your BI system.

I will go forward with option 1 but will not use Kibana for counting where explicit unique count is required.

---

<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 16, 2018, 4:52pm UTC](https://discuss.elastic.co/t/explicit-unique-count-for-business-intelligence-tasks-no-chance/118641/5 "2018-03-16T16:52:19Z")

</div>

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