# How to use sum aggregation in scripted field

**URL:** <https://discuss.elastic.co/t/how-to-use-sum-aggregation-in-scripted-field/232380>\
**Category:** Kibana\
**Created:** [May 13, 2020, 7:46am UTC](https://discuss.elastic.co/t/how-to-use-sum-aggregation-in-scripted-field/232380 "2020-05-13T07:46:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emna1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emna1/32/64354_2.png) [@Emna1](https://discuss.elastic.co/u/Emna1)\
**Post date:** [May 13, 2020, 7:46am UTC](https://discuss.elastic.co/t/how-to-use-sum-aggregation-in-scripted-field/232380/1 "2020-05-13T07:46:33Z")

</div>

HI, for example when i create a bar visualisation i can do the sum aggregation for specific field but when i do a control visualisation he can take just the field not sum of field so my problem is i need to create a scripted field with sum aggregation and after that use it in control visualisation?  
Any way to do that please??or any other solution ?

---

<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:** [June 10, 2020, 7:46am UTC](https://discuss.elastic.co/t/how-to-use-sum-aggregation-in-scripted-field/232380/2 "2020-06-10T07:46:36Z")

</div>

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