# How to reference timerange value in scripted field?

**URL:** <https://discuss.elastic.co/t/how-to-reference-timerange-value-in-scripted-field/28918>\
**Category:** Kibana\
**Created:** [September 9, 2015, 9:37am UTC](https://discuss.elastic.co/t/how-to-reference-timerange-value-in-scripted-field/28918 "2015-09-09T09:37:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zkun](https://avatars.discourse-cdn.com/v4/letter/z/8797f3/32.png) [@zkun](https://discuss.elastic.co/u/zkun)\
**Post date:** [September 9, 2015, 9:37am UTC](https://discuss.elastic.co/t/how-to-reference-timerange-value-in-scripted-field/28918/1 "2015-09-09T09:37:38Z")

</div>

Hi all, here comes a weird requirement (but indeed necessary) on my project: I need to multiple one field value with the number of days of dashboard time range.  
I know with scripted field feature I could do some easy calc upon field value, but I do have no idea on how to achieve this.  
Could you guys help out? Thanks.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 11, 2015, 6:50am UTC](https://discuss.elastic.co/t/how-to-reference-timerange-value-in-scripted-field/28918/2 "2015-09-11T06:50:44Z")

</div>

I can't see that this would be possible, as the script won't know the time range you have used.

---

<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 6, 2017, 2:13pm UTC](https://discuss.elastic.co/t/how-to-reference-timerange-value-in-scripted-field/28918/3 "2017-07-06T14:13:19Z")

</div>


