# Getting total sum of all buckets in Kibana

**URL:** <https://discuss.elastic.co/t/getting-total-sum-of-all-buckets-in-kibana/260380>\
**Category:** Kibana\
**Created:** [January 6, 2021, 6:49pm UTC](https://discuss.elastic.co/t/getting-total-sum-of-all-buckets-in-kibana/260380 "2021-01-06T18:49:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![schwalbe](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@schwalbe](https://discuss.elastic.co/u/schwalbe)\
**Post date:** [January 6, 2021, 6:49pm UTC](https://discuss.elastic.co/t/getting-total-sum-of-all-buckets-in-kibana/260380/1 "2021-01-06T18:49:46Z")

</div>

Hi there, I am very new and unexperienced in ELK. What I am searching for is a way to get the total sum of values (rows) in a table. With the result of this I want to calculate e.g. the ratio of the total average and a single row which is "single row / (total sum / number of rows)". Kibana provides the total sum in the vizualisation (see screenshot) but I don't know how to get access to this for further calculation, for instance to use it in an inline script. Thanks for any hint.  
Peter

 ![Kibana_table](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d5c364de4f8d048c092f816bfe253bdc54f6125a.png)

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [January 6, 2021, 6:53pm UTC](https://discuss.elastic.co/t/getting-total-sum-of-all-buckets-in-kibana/260380/2 "2021-01-06T18:53:48Z")

</div>

Hi, welcome to the forums! Am I correct that you want to look at the percentage of a row compared to the sum of all rows? This feature is called the "percentage column" in our data table. This might solve your use case.

It's not possible to do scripting using the Kibana table visualization. There is a community plugin called Kibana enhanced table which some users have had success with.

---

<div class="post-metadata">

**Author:** ![schwalbe](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@schwalbe](https://discuss.elastic.co/u/schwalbe)\
**Post date:** [January 6, 2021, 7:19pm UTC](https://discuss.elastic.co/t/getting-total-sum-of-all-buckets-in-kibana/260380/3 "2021-01-06T19:19:23Z")

</div>

Hi Wylie, thanks for your quick answer. But no, it's not that. The percentage column of a row is "row / sum of rows" and I know that this is standard feature of Kibana. What I am looking for is "row / average of rows".

By the way: What I mean is the _advanced_ feature in the metric definition which I considered scripting. Maybe I am wrong or it´s a matter of definition. Anyway 😉

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [January 6, 2021, 7:29pm UTC](https://discuss.elastic.co/t/getting-total-sum-of-all-buckets-in-kibana/260380/4 "2021-01-06T19:29:16Z")

</div>

That is definitely not possible to calculate using the Kibana table, and I think the only way to calculate that is to run multiple passes of aggregation. You could set up a [transformation job](https://www.elastic.co/guide/en/elasticsearch/reference/current/transforms.html) which has a lot of scripting capabilities, and then aggregate the results from the transformed index.

---

<div class="post-metadata">

**Author:** ![schwalbe](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@schwalbe](https://discuss.elastic.co/u/schwalbe)\
**Post date:** [January 6, 2021, 8:03pm UTC](https://discuss.elastic.co/t/getting-total-sum-of-all-buckets-in-kibana/260380/5 "2021-01-06T20:03:55Z")

</div>

Hi Wylie, that make things clear, thanks a lot. I'm going to check out transformation job, sounds promissing.

---

<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:** [February 3, 2021, 8:03pm UTC](https://discuss.elastic.co/t/getting-total-sum-of-all-buckets-in-kibana/260380/6 "2021-02-03T20:03:59Z")

</div>

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