# Create scripted field

**URL:** <https://discuss.elastic.co/t/create-scripted-field/237666>\
**Category:** Kibana\
**Created:** [June 18, 2020, 3:27pm UTC](https://discuss.elastic.co/t/create-scripted-field/237666 "2020-06-18T15:27:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiba](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hiba/32/110919_2.png) [@hiba](https://discuss.elastic.co/u/hiba)\
**Post date:** [June 18, 2020, 3:27pm UTC](https://discuss.elastic.co/t/create-scripted-field/237666/1 "2020-06-18T15:27:38Z")

</div>

Hi ,  
how can i create this scripted field.

i want to calculate the avg of "price".

 ![1](https://us1.discourse-cdn.com/elastic/original/3X/3/2/32de041a47c1ff0eade9a6b69e67f3b84e3cf69d.png) ![2](https://us1.discourse-cdn.com/elastic/original/3X/f/5/f53970050d024b73a3c4f1eae298e65abb9edef7.png)

any help please!

---

<div class="post-metadata">

**Author:** ![monfera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monfera/32/26467_2.png) [@monfera](https://discuss.elastic.co/u/monfera)\
**Post date:** [June 18, 2020, 7:24pm UTC](https://discuss.elastic.co/t/create-scripted-field/237666/2 "2020-06-18T19:24:21Z")

</div>

Hello, where is the example sourced from and which Kibana version are you using? You may find this thread useful [Scripted field in kibana (count)](https://discuss.elastic.co/t/scripted-field-in-kibana-count/140647/4)

---

<div class="post-metadata">

**Author:** ![hiba](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hiba/32/110919_2.png) [@hiba](https://discuss.elastic.co/u/hiba)\
**Post date:** [June 19, 2020, 8:10am UTC](https://discuss.elastic.co/t/create-scripted-field/237666/3 "2020-06-19T08:10:22Z")

</div>

i use kibana 7.7.0

i create a scripted field with the fuction sum and it's work fine.  
 ![l](https://us1.discourse-cdn.com/elastic/original/3X/3/7/370e4dd8984db3351957181430e70a951c108fd9.png)

my goal is to calculate fields from documents and use the results of this calculation in visualizations ! how can i acheive this

---

<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 17, 2020, 8:10am UTC](https://discuss.elastic.co/t/create-scripted-field/237666/4 "2020-07-17T08:10:28Z")

</div>

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