# Scripted field to display custom metrics in a table visualization

**URL:** <https://discuss.elastic.co/t/scripted-field-to-display-custom-metrics-in-a-table-visualization/135718>\
**Category:** Kibana\
**Created:** [June 13, 2018, 12:31pm UTC](https://discuss.elastic.co/t/scripted-field-to-display-custom-metrics-in-a-table-visualization/135718 "2018-06-13T12:31:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![espogian](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@espogian](https://discuss.elastic.co/u/espogian)\
**Post date:** [June 13, 2018, 12:31pm UTC](https://discuss.elastic.co/t/scripted-field-to-display-custom-metrics-in-a-table-visualization/135718/1 "2018-06-13T12:31:38Z")

</div>

Hi, I'm new to scripted fields in Kibana.  
I have created a really simple table visualization which has an Average as metric and other Terms as Buckets. Therefore the output is like this:

```
Items Average
---------------------
Item1 x
Item2 y
Item3 z
...
ItemN t

```

What I would like to achieve is getting another column which is based on a formula:

NewColumn = Number of ItemX items which have Average greater than x% / Total number of ItemX

It would be very beneficial to me to get an example 🙂

---

<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:** [June 13, 2018, 1:19pm UTC](https://discuss.elastic.co/t/scripted-field-to-display-custom-metrics-in-a-table-visualization/135718/2 "2018-06-13T13:19:18Z")

</div>

Hi espogian, I don't think it's possible within our table visualizations. You _may_ be able to do something similar using a filter ratio. See this thread for an example of that:

> [@Data table multiple columns](https://discuss.elastic.co/t/data-table-multiple-columns/134589):
>
> Hi, I have created a data table visualization and i am taking count as metric.Now i want one more column where i wish to take percentage as metric which will give me the percentage of the respective count value for the rows.Is it possible to achieve this in kibana 6.2.2?

Best of luck!

---

<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 11, 2018, 1:19pm UTC](https://discuss.elastic.co/t/scripted-field-to-display-custom-metrics-in-a-table-visualization/135718/3 "2018-07-11T13:19:30Z")

</div>

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