# Kibana Painless Scripted Fields

**URL:** <https://discuss.elastic.co/t/kibana-painless-scripted-fields/197620>\
**Category:** Kibana\
**Tags:** painless\
**Created:** [September 1, 2019, 11:36am UTC](https://discuss.elastic.co/t/kibana-painless-scripted-fields/197620 "2019-09-01T11:36:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mg\_Mogaki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mg_mogaki/32/53414_2.png) [@Mg\_Mogaki](https://discuss.elastic.co/u/Mg_Mogaki)\
**Post date:** [September 1, 2019, 11:36am UTC](https://discuss.elastic.co/t/kibana-painless-scripted-fields/197620/1 "2019-09-01T11:36:39Z")

</div>

I'm new to Kibana. I've been tasked with replicating an excel report into a dashboard.

I want to use a data table to display my values and also have a calculated field for percentages.  
The percentiles metric is not what I am trying to use to perform my calculations.

In the excel report the percentages are calculated using a formula like this :  
=I20/$I$28\*100

It's a relatively simple formula I want to replicate in Kibana. Is there a way to create a scripted field in Painless or is there an even easier way to do this?

Some assistance would be much appreciated.

Thanks in advance.

---

<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:** [September 2, 2019, 8:11pm UTC](https://discuss.elastic.co/t/kibana-painless-scripted-fields/197620/2 "2019-09-02T20:11:59Z")

</div>

Painless is server side technology. Scripted fields are Kibana technology, they might suit your purpose: [https://www.elastic.co/guide/en/kibana/current/scripted-fields.html](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html)

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 3, 2019, 5:14am UTC](https://discuss.elastic.co/t/kibana-painless-scripted-fields/197620/3 "2019-09-03T05:14:51Z")

</div>

Note that scripted fields are created/calculated in the context of each document and you are looking to perform a calculation based on the result of an aggregation. I therefore do not think scripted fields alone will help here. It may be possible to do this using Canvas, which as far as I know is more flexible.

---

<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:** [October 1, 2019, 5:14am UTC](https://discuss.elastic.co/t/kibana-painless-scripted-fields/197620/4 "2019-10-01T05:14:52Z")

</div>

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