# Add script for Kibana aggregations

**URL:** <https://discuss.elastic.co/t/add-script-for-kibana-aggregations/195004>\
**Category:** Kibana\
**Created:** [August 13, 2019, 10:19am UTC](https://discuss.elastic.co/t/add-script-for-kibana-aggregations/195004 "2019-08-13T10:19:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HauVan](https://avatars.discourse-cdn.com/v4/letter/h/bc79bd/32.png) [@HauVan](https://discuss.elastic.co/u/HauVan)\
**Post date:** [August 13, 2019, 10:19am UTC](https://discuss.elastic.co/t/add-script-for-kibana-aggregations/195004/1 "2019-08-13T10:19:26Z")

</div>

Hi guys,  
i have a datatable like below

 ![47%20PM](https://us1.discourse-cdn.com/elastic/original/3X/a/2/a2f61a2ee4b07ce17f390803cf09ab3a6d7b9500.png)

What im trying to do is create scripting for my third column, the rule will look like this.  
-We have know the ORDER\_WAITING\_FOR\_PLANNING is 102 so we call this total\_order, then third column will have formula like this: total\_order - doc\_count (doc\_count in column 2).

Im really new in Kibana, so any guidance would be big help, Thank for reading

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [August 13, 2019, 10:24pm UTC](https://discuss.elastic.co/t/add-script-for-kibana-aggregations/195004/2 "2019-08-13T22:24:56Z")

</div>

Unfortunately I don't think this is currently possible. You can follow the progress of this feature request here: [https://github.com/elastic/kibana/issues/2646](https://github.com/elastic/kibana/issues/2646)

---

<div class="post-metadata">

**Author:** ![HauVan](https://avatars.discourse-cdn.com/v4/letter/h/bc79bd/32.png) [@HauVan](https://discuss.elastic.co/u/HauVan)\
**Post date:** [August 14, 2019, 12:22am UTC](https://discuss.elastic.co/t/add-script-for-kibana-aggregations/195004/3 "2019-08-14T00:22:14Z")

</div>

Hi lukas,  
Thank for response, i have research about scripted field, do you think it can help me in this case ?

---

<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:** [September 11, 2019, 12:22am UTC](https://discuss.elastic.co/t/add-script-for-kibana-aggregations/195004/4 "2019-09-11T00:22:25Z")

</div>

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