# How to query a sum and it's percentage in the same query?

**URL:** <https://discuss.elastic.co/t/how-to-query-a-sum-and-its-percentage-in-the-same-query/381229>\
**Category:** Elasticsearch\
**Tags:** esql\
**Created:** [August 22, 2025, 8:50am UTC](https://discuss.elastic.co/t/how-to-query-a-sum-and-its-percentage-in-the-same-query/381229 "2025-08-22T08:50:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [August 22, 2025, 11:01am UTC](https://discuss.elastic.co/t/how-to-query-a-sum-and-its-percentage-in-the-same-query/381229/2 "2025-08-22T11:01:20Z")

</div>

Hello @khat33b

Please check below post regarding your question to show % , if it is helpful :

> [@Creating a Kinana table using a multi-field with es|ql](https://discuss.elastic.co/t/creating-a-kinana-table-using-a-multi-field-with-es-ql/377972):
>
> v 8.17.4 I am trying to create a visualisation table in Kibana using an es|ql query. The main field in question is a Keyword multi-field call ItemsFound. I want the first column to be a list of unique items found. Column two is a count of the ItemsFound Column three will be a percentage of ItemsFound I can get the first two columns working just using Kibana but I can't get the percentage, even with a formula. ItemsFound ["Item B", "Item W", "Item H"] ItemsFound [ "Item B", "Item R", "…

Thanks!!

---

_[View the full topic](https://discuss.elastic.co/t/how-to-query-a-sum-and-its-percentage-in-the-same-query/381229)._
