# Weekly Aggregations - Date Histogram Aggregations

**URL:** <https://discuss.elastic.co/t/weekly-aggregations-date-histogram-aggregations/64008>\
**Category:** Elasticsearch\
**Created:** [October 26, 2016, 1:25pm UTC](https://discuss.elastic.co/t/weekly-aggregations-date-histogram-aggregations/64008 "2016-10-26T13:25:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chandan\_PR](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@Chandan\_PR](https://discuss.elastic.co/u/Chandan_PR)\
**Post date:** [October 26, 2016, 1:25pm UTC](https://discuss.elastic.co/t/weekly-aggregations-date-histogram-aggregations/64008/1 "2016-10-26T13:25:31Z")

</div>

Hi Guys,

When we apply the weekly aggregation, we consider the key as start day of the week and the key\_as\_string is returned as per that.

Is there any possibility to return the key\_as\_string to be 'start\_day\_of\_week - end\_day\_of\_week'?

Regards,  
Chandan

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [October 26, 2016, 3:23pm UTC](https://discuss.elastic.co/t/weekly-aggregations-date-histogram-aggregations/64008/2 "2016-10-26T15:23:50Z")

</div>

> [@Chandan\_PR](#):
>
> Is there any possibility to return the key\_as\_string to be 'start\_day\_of\_week - end\_day\_of\_week'

I don't think it is currently possible since the `key` (and also `key_as_string`) is solely intended to be a bucket identifier, not something that is intended for direct use in a graph, for example. I came across this [issue](https://github.com/elastic/elasticsearch/issues/9528) recently which talks a bit about scripted formatting of this, but I don't think this has really made it as a feature request yet.

---

<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:** [July 5, 2017, 10:09pm UTC](https://discuss.elastic.co/t/weekly-aggregations-date-histogram-aggregations/64008/3 "2017-07-05T22:09:24Z")

</div>


