# Kibana formula "reducedTimeRange" not working

**URL:** https://discuss.elastic.co/t/kibana-formula-reducedtimerange-not-working/353243
**Category:** Kibana
**Tags:** dashboard
**Created:** [February 14, 2024, 8:52am UTC](https://discuss.elastic.co/t/kibana-formula-reducedtimerange-not-working/353243 "2024-02-14T08:52:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![SamehSaeed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samehsaeed/32/145262_2.png) [@SamehSaeed](https://discuss.elastic.co/u/SamehSaeed)
#### Post date: [February 14, 2024, 8:52am UTC](https://discuss.elastic.co/t/kibana-formula-reducedtimerange-not-working/353243/1 "2024-02-14T08:52:17Z")

</div>

I'm facing an issue while creating a visualization, whenever i use "reducedTimeRange" the result value becomes 0.

 ![Count Now](https://us1.discourse-cdn.com/elastic/original/3X/0/4/040c7f611f4344164dbdabfecb77c3a8514411d6.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/d/4d084a5c0e5814147abed858f006a896df800080.png)

---

<div class="post-metadata">

### Author: ![SamehSaeed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samehsaeed/32/145262_2.png) [@SamehSaeed](https://discuss.elastic.co/u/SamehSaeed)
#### Post date: [February 15, 2024, 11:17am UTC](https://discuss.elastic.co/t/kibana-formula-reducedtimerange-not-working/353243/3 "2024-02-15T11:17:53Z")

</div>

Found the solution, If you set date range to "Today" it will set the time from "00:00:00" to "23:59:59".  
Using -5m reduced time range on the end of day will be "23:54:59" which does not have data yet, and that's why it will be empty. You just have to edit the "Today" statement from :  
Stack Management ==\> Advanced Settings ==\> Time filter quick ranges

Change

```auto
{
    "from": "now/d",
    "to": "now/d",
    "display": "Today"
  }

```

To

```auto
{
    "from": "now/d",
    "to": "now",
    "display": "Today"
  }

```

So next time when you set date range to "Today" it will set the time from "00:00:00" to "Now" instead, and the reduced time range will always work if you are working with real time data.

---

<div class="post-metadata">

### Author: ![ersalil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ersalil/32/131773_2.png) [@ersalil](https://discuss.elastic.co/u/ersalil)
#### Post date: [February 15, 2024, 12:16pm UTC](https://discuss.elastic.co/t/kibana-formula-reducedtimerange-not-working/353243/4 "2024-02-15T12:16:30Z")

</div>

Try using unique\_count(seqid, shift='30m')

---

<div class="post-metadata">

### Author: ![SamehSaeed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samehsaeed/32/145262_2.png) [@SamehSaeed](https://discuss.elastic.co/u/SamehSaeed)
#### Post date: [February 18, 2024, 7:13am UTC](https://discuss.elastic.co/t/kibana-formula-reducedtimerange-not-working/353243/5 "2024-02-18T07:13:36Z")

</div>

@ersalil "shift" feature changes both start and end dates, and if you try to apply it in a data table an error will pop up  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/5/8569aa1c9699c78f993cdee012e859c2bc622154.png)

Thanks for your comment though 😄.

---

<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: [March 17, 2024, 7:14am UTC](https://discuss.elastic.co/t/kibana-formula-reducedtimerange-not-working/353243/6 "2024-03-17T07:14:09Z")

</div>

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