# Urgent Help: How to use date range in sub-aggregation in Kibana

**URL:** <https://discuss.elastic.co/t/urgent-help-how-to-use-date-range-in-sub-aggregation-in-kibana/280467>\
**Category:** Kibana\
**Created:** [August 4, 2021, 6:49pm UTC](https://discuss.elastic.co/t/urgent-help-how-to-use-date-range-in-sub-aggregation-in-kibana/280467 "2021-08-04T18:49:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BIIntern1](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@BIIntern1](https://discuss.elastic.co/u/BIIntern1)\
**Post date:** [August 4, 2021, 6:49pm UTC](https://discuss.elastic.co/t/urgent-help-how-to-use-date-range-in-sub-aggregation-in-kibana/280467/1 "2021-08-04T18:49:27Z")

</div>

Hi all,  
I am trying to slice the data in Kibana using date range sub aggregation. It is giving me the required data in required format when I am putting just "now" for To but when I tried putting "now-1d" under To in order to get the data points between the time range of 14days ago and yesterday, it is giving me "-" in the last field which is the main field I want to work with.

Suprisingly everything I put under format is working until and unless the value for To is kept as "now" which I do not want because I want to slice the data. I am not sure where I am going wrong. I would really appreciate if someone could please help me with this.

For reference, I have attached the screenshot as well.

 ![Screen Shot 2021-08-04 at 2.41.06 PM](https://us1.discourse-cdn.com/elastic/original/3X/4/5/458fe2f7fee5676b2550b44b9784c67ee922141b.png)

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [August 4, 2021, 10:16pm UTC](https://discuss.elastic.co/t/urgent-help-how-to-use-date-range-in-sub-aggregation-in-kibana/280467/2 "2021-08-04T22:16:50Z")

</div>

@Stratoula_Kalafateli can we please get some help on this please? I tried in my local and not sure what is really happening.

Thanks  
Bhavya

---

<div class="post-metadata">

**Author:** ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)\
**Post date:** [August 5, 2021, 6:40am UTC](https://discuss.elastic.co/t/urgent-help-how-to-use-date-range-in-sub-aggregation-in-kibana/280467/3 "2021-08-05T06:40:43Z")

</div>

@BIIntern1 can you please tell me which version of kibana you are using?

---

<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:** [September 2, 2021, 6:41am UTC](https://discuss.elastic.co/t/urgent-help-how-to-use-date-range-in-sub-aggregation-in-kibana/280467/4 "2021-09-02T06:41:25Z")

</div>

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