# Scripted field and standard deviation

**URL:** <https://discuss.elastic.co/t/scripted-field-and-standard-deviation/188569>\
**Category:** Kibana\
**Created:** [July 2, 2019, 6:54pm UTC](https://discuss.elastic.co/t/scripted-field-and-standard-deviation/188569 "2019-07-02T18:54:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_Mak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_mak/32/42230_2.png) [@Joseph\_Mak](https://discuss.elastic.co/u/Joseph_Mak)\
**Post date:** [July 2, 2019, 6:54pm UTC](https://discuss.elastic.co/t/scripted-field-and-standard-deviation/188569/1 "2019-07-02T18:54:31Z")

</div>

Is there a way to get standard deviation in a scripted field?

According to this old Kibana 4 link... you can't. Has that been changed?

> [@Mean support in kibana4.x](https://discuss.elastic.co/t/mean-support-in-kibana4-x/35860):
>
> Hi All I worked on kibana 3 it has means support there but coming to kibana 4 we have lack of functions that kibana 3 supporting that is mean,variance etc.. can these possible in kibana 4 is there any other way to achieve in kibana 4 please suggest me. Thanks, phani

---

<div class="post-metadata">

**Author:** ![christophilus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christophilus/32/42991_2.png) [@christophilus](https://discuss.elastic.co/u/christophilus)\
**Post date:** [July 2, 2019, 8:24pm UTC](https://discuss.elastic.co/t/scripted-field-and-standard-deviation/188569/2 "2019-07-02T20:24:32Z")

</div>

I'm not sure about scripted fields, but standard deviation is a standard query in Elasticsearch, so it's fairly easy to grab. Most visualizations will let you plot it, for example.

---

<div class="post-metadata">

**Author:** ![Joseph\_Mak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_mak/32/42230_2.png) [@Joseph\_Mak](https://discuss.elastic.co/u/Joseph_Mak)\
**Post date:** [July 3, 2019, 5:41pm UTC](https://discuss.elastic.co/t/scripted-field-and-standard-deviation/188569/3 "2019-07-03T17:41:08Z")

</div>

Thanks... let me clarify my question.. so in scripted field you can do doc['myfield'].value to get a particular value... (or do some other painless script in it). I am asking... is there a way to retrieve standard deviation for a particular field in the painless script for 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:** [July 31, 2019, 5:41pm UTC](https://discuss.elastic.co/t/scripted-field-and-standard-deviation/188569/4 "2019-07-31T17:41:13Z")

</div>

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