# Date histogram does not work properly with unique count value

**URL:** <https://discuss.elastic.co/t/date-histogram-does-not-work-properly-with-unique-count-value/261223>\
**Category:** Kibana\
**Created:** [January 15, 2021, 8:03am UTC](https://discuss.elastic.co/t/date-histogram-does-not-work-properly-with-unique-count-value/261223 "2021-01-15T08:03:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdul\_Rahman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdul_rahman/32/78646_2.png) [@Abdul\_Rahman](https://discuss.elastic.co/u/Abdul_Rahman)\
**Post date:** [January 15, 2021, 8:03am UTC](https://discuss.elastic.co/t/date-histogram-does-not-work-properly-with-unique-count-value/261223/1 "2021-01-15T08:03:55Z")

</div>

Hello,

I am using ELK 7.3 bar chart in kibana and did create unique count chart of value with date histogram but the when I use interval of monthly basis it skips one record in few months ,  
Any idea guys how to resolve it

Thanks

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [January 15, 2021, 8:09am UTC](https://discuss.elastic.co/t/date-histogram-does-not-work-properly-with-unique-count-value/261223/2 "2021-01-15T08:09:13Z")

</div>

Hey, can you show an example of this behavior?

- Which documents do have in your index?
- How is your chart configured exactly?
- What are you expecting vs what is showed?

> use interval of monthly basis it skips one record in few months

You mean you know the unique count of ips should be one higher?

---

<div class="post-metadata">

**Author:** ![Abdul\_Rahman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdul_rahman/32/78646_2.png) [@Abdul\_Rahman](https://discuss.elastic.co/u/Abdul_Rahman)\
**Post date:** [January 15, 2021, 8:20am UTC](https://discuss.elastic.co/t/date-histogram-does-not-work-properly-with-unique-count-value/261223/3 "2021-01-15T08:20:28Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/e/9/e911b33253f194710c8afbe3c6e77d4b0f64b7e8.png)

---

<div class="post-metadata">

**Author:** ![Abdul\_Rahman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdul_rahman/32/78646_2.png) [@Abdul\_Rahman](https://discuss.elastic.co/u/Abdul_Rahman)\
**Post date:** [January 15, 2021, 8:21am UTC](https://discuss.elastic.co/t/date-histogram-does-not-work-properly-with-unique-count-value/261223/4 "2021-01-15T08:21:21Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/6/6/66ce5e59827875da8f805dad2f9df2f1126664f8.png)

above is date histogram

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [January 15, 2021, 8:29am UTC](https://discuss.elastic.co/t/date-histogram-does-not-work-properly-with-unique-count-value/261223/5 "2021-01-15T08:29:28Z")

</div>

I see, thanks. The unique count aggregation of Elasticsearch isn't always 100% accurate, trading precision for performance (see [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#\_precision\_control](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#_precision_control))

You should be able to control this trade-off by using the "Advanced \> JSON input" setting:

```auto
{ "precision_threshold": 4000 }

```

---

<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 12, 2021, 8:29am UTC](https://discuss.elastic.co/t/date-histogram-does-not-work-properly-with-unique-count-value/261223/6 "2021-02-12T08:29:40Z")

</div>

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