# Custom week intervals in date\_histogram aggregations

**URL:** <https://discuss.elastic.co/t/custom-week-intervals-in-date-histogram-aggregations/201961>\
**Category:** Elasticsearch\
**Created:** [October 2, 2019, 1:54pm UTC](https://discuss.elastic.co/t/custom-week-intervals-in-date-histogram-aggregations/201961 "2019-10-02T13:54:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mnv/32/42326_2.png) [@mnv](https://discuss.elastic.co/u/mnv)\
**Post date:** [October 2, 2019, 1:54pm UTC](https://discuss.elastic.co/t/custom-week-intervals-in-date-histogram-aggregations/201961/1 "2019-10-02T13:54:27Z")

</div>

Hello!  
I want create a buckets with date\_histogram with week interval, but I need a week that starts at Thursday and ends on Wednesday from next week: 29.08-04.09, 05.09-11.09, eg. Is that possible in one query?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 2, 2019, 2:52pm UTC](https://discuss.elastic.co/t/custom-week-intervals-in-date-histogram-aggregations/201961/2 "2019-10-02T14:52:10Z")

</div>

Welcome!

I'd look at offset. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html#\_offset](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html#_offset)

HTH

---

<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:** [October 30, 2019, 2:53pm UTC](https://discuss.elastic.co/t/custom-week-intervals-in-date-histogram-aggregations/201961/3 "2019-10-30T14:53:09Z")

</div>

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