# Scripted field result related to time range selected

**URL:** <https://discuss.elastic.co/t/scripted-field-result-related-to-time-range-selected/150994>\
**Category:** Kibana\
**Created:** [October 4, 2018, 8:16am UTC](https://discuss.elastic.co/t/scripted-field-result-related-to-time-range-selected/150994 "2018-10-04T08:16:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jtebbens](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jtebbens](https://discuss.elastic.co/u/jtebbens)\
**Post date:** [October 4, 2018, 8:16am UTC](https://discuss.elastic.co/t/scripted-field-result-related-to-time-range-selected/150994/1 "2018-10-04T08:16:35Z")

</div>

Hi there, I am investigating if there is a way to use a scripted field in a way related to the time range for the dashboard. So I want to calculate a value like availability in % and use the time filter (top right).  
So imagine 90% availability for 24hours would mean downtime 24h/10% = 144 minutes down.  
Does scripted field allow this via "painless" or what other options are there?

Thanks,  
Jeroen Tebbens

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [October 4, 2018, 10:45am UTC](https://discuss.elastic.co/t/scripted-field-result-related-to-time-range-selected/150994/2 "2018-10-04T10:45:10Z")

</div>

Hello,  
Sadly this is not possible, you cannot access the time range from inside a scripted field.

---

<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:** [November 1, 2018, 10:47am UTC](https://discuss.elastic.co/t/scripted-field-result-related-to-time-range-selected/150994/3 "2018-11-01T10:47:10Z")

</div>

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