# Error message with scripted field when changing the date range

**URL:** https://discuss.elastic.co/t/error-message-with-scripted-field-when-changing-the-date-range/205768
**Category:** Kibana
**Created:** [October 29, 2019, 11:53pm UTC](https://discuss.elastic.co/t/error-message-with-scripted-field-when-changing-the-date-range/205768 "2019-10-29T23:53:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jogabonito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jogabonito/32/56737_2.png) [@jogabonito](https://discuss.elastic.co/u/jogabonito)
#### Post date: [October 29, 2019, 11:53pm UTC](https://discuss.elastic.co/t/error-message-with-scripted-field-when-changing-the-date-range/205768/1 "2019-10-29T23:53:58Z")

</div>

Hi

I use Kibana v 7.3.2

I get two error messages under whenever I try to change the date ranges in my dashboard. I have one scripted field which calculates the percentage using two other fields in the same index.  
The scripted field has this syntax:  
100 \* doc['totalbelastning'].value / doc['trafoytelse'].value

Error message:  
1)  
Error: in cell #1: [script\_exception] runtime error, with { script\_stack={ 0="org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:94)" & 1="org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:41)" & 2="100 \* doc['totalbelastning'].value / doc['trafoytelse'].value }, params.gte)" & 3=" ^---- HERE" } & script="boolean gte(Supplier s, def v) {return s.get() \>= v}gte(() -\> { 100 \* doc['totalbelastning'].value / doc['trafoytelse'].value }, params.gte)" & lang="painless" }

1. 

[timelion\_vis] \> Error: in cell #1: [script\_exception] runtime error, with { script\_stack={ 0="org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:94)" & 1="org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:41)" & 2="100 \* doc['totalbelastning'].value / doc['trafoytelse'].value }, params.gte)" & 3=" ^---- HERE" } & script="boolean gte(Supplier s, def v) {return s.get() \>= v}gte(() -\> { 100 \* doc['totalbelastning'].value / doc['trafoytelse'].value }, params.gte)" & lang="painless" }

---

<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: [November 18, 2019, 3:29pm UTC](https://discuss.elastic.co/t/error-message-with-scripted-field-when-changing-the-date-range/205768/2 "2019-11-18T15:29:14Z")

</div>

are those 2 fields `totalbelastning` and `trafoytelse` present in each document? if not, you should do some `exists` checks in the scripted field in order to handle errors.  
From those traces it's hard to see what the problem is, there should be more info lower in the logs if you can find it and post it here.

---

<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: [December 16, 2019, 3:29pm UTC](https://discuss.elastic.co/t/error-message-with-scripted-field-when-changing-the-date-range/205768/3 "2019-12-16T15:29:17Z")

</div>

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