# Date range with date histogram (This interval creates too many buckets)

**URL:** <https://discuss.elastic.co/t/date-range-with-date-histogram-this-interval-creates-too-many-buckets/69023>\
**Category:** Kibana\
**Created:** [December 14, 2016, 1:36pm UTC](https://discuss.elastic.co/t/date-range-with-date-histogram-this-interval-creates-too-many-buckets/69023 "2016-12-14T13:36:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![celebi](https://avatars.discourse-cdn.com/v4/letter/c/c77e96/32.png) [@celebi](https://discuss.elastic.co/u/celebi)\
**Post date:** [December 14, 2016, 1:36pm UTC](https://discuss.elastic.co/t/date-range-with-date-histogram-this-interval-creates-too-many-buckets/69023/1 "2016-12-14T13:36:44Z")

</div>

Hi all,

I am relatively new to ELK stack and try to use date range with date histogram regardless of time picker tool. But it seems Kibana behaves differently when I select time picker \<= "Last 1 year" compared to \>= "Last 2 year". So I get "This interval creates too many buckets to show in the selected time range....." if choose last 2 year or more, thus I can not set interval to daily. If I choose something less than, it works smoothly the way I want.

Because Kibana changes interval automatically although there are a few hit. However I want to have that interval explicitly.

I found [that link](https://github.com/elastic/kibana/issues/4459) on the web. I tried it, but Kibana gave me error like **Visualize: Unknown key for a VALUE\_BOOLEAN in [3]: [pre\_zone\_adjust\_large\_interval]**

What I want to achieve is having dashboard with different time slot like hourly analysis in last 24 hours or daily in last 30 days. But I also would like to keep time picker at 2 year as I want to see some charts which use that time slot.

Any chance to do that without scripting. If not how can I do that ? Thanks.

Cheers

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [December 14, 2016, 2:26pm UTC](https://discuss.elastic.co/t/date-range-with-date-histogram-this-interval-creates-too-many-buckets/69023/2 "2016-12-14T14:26:14Z")

</div>

Hi @celebi,

The minimal size of the buckets used by the date histogram aggregation is always calculated relative to the time interval selected in the time picker. In general, having different time intervals for different visualization on the same dashboard is not supported right now. The workaround you linked to worked for me when I just tried it out when leaving out the key `pre_zone_adjust_large_interval` (it was removed in Elasticsearch 2.0).

---

<div class="post-metadata">

**Author:** ![celebi](https://avatars.discourse-cdn.com/v4/letter/c/c77e96/32.png) [@celebi](https://discuss.elastic.co/u/celebi)\
**Post date:** [December 15, 2016, 7:27am UTC](https://discuss.elastic.co/t/date-range-with-date-histogram-this-interval-creates-too-many-buckets/69023/3 "2016-12-15T07:27:03Z")

</div>

Hi @weltenwort

Thanks for your reply. Isn't that strange that Kibana scaled it automatically although there are a few hits where it can easily show buckets! I think it should be scaled by number of hits not by time picker. Thanks for workaround suggestion, it worked without `pre_zone_adjust_large_interval`.

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [December 15, 2016, 9:59am UTC](https://discuss.elastic.co/t/date-range-with-date-histogram-this-interval-creates-too-many-buckets/69023/4 "2016-12-15T09:59:01Z")

</div>

I agree that the scaling algorithm is very simplistic. There is an [enhancement issue](https://github.com/elastic/kibana/issues/2991) open in the Kibana repository, that is related. Feel free to add your use-cases and thoughts to it to give it some more weight.

---

<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:** [January 12, 2017, 9:59am UTC](https://discuss.elastic.co/t/date-range-with-date-histogram-this-interval-creates-too-many-buckets/69023/5 "2017-01-12T09:59:02Z")

</div>

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