# Calculate the percentage of a bucket over the total

**URL:** https://discuss.elastic.co/t/calculate-the-percentage-of-a-bucket-over-the-total/188446
**Category:** Elasticsearch
**Created:** [July 2, 2019, 7:17am UTC](https://discuss.elastic.co/t/calculate-the-percentage-of-a-bucket-over-the-total/188446 "2019-07-02T07:17:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![algorrim](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@algorrim](https://discuss.elastic.co/u/algorrim)
#### Post date: [July 2, 2019, 7:17am UTC](https://discuss.elastic.co/t/calculate-the-percentage-of-a-bucket-over-the-total/188446/1 "2019-07-02T07:17:24Z")

</div>

Hi!

I'm quite new with Elasticsearch and I'm exploring the analytics feature of ES. I was trying to calculate the percentage of each bucket from a histogram over the total. So if I have three buckets with these values:  
A = 3  
B = 10  
C = 7  
I'd like to add these values to the buckets as well:  
A = 3; 0.15  
B = 10; 0.5  
C = 7; 0.35

However, I couldn't find a way to do so. I found some old threads about this topic saying that it's not possible. I'd like to know if this is possible nowadays and if not, if it there is a chance it could be added in the future.

---

<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 30, 2019, 7:17am UTC](https://discuss.elastic.co/t/calculate-the-percentage-of-a-bucket-over-the-total/188446/2 "2019-07-30T07:17:28Z")

</div>

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