# How Do I Aggregate With Percentile Rank Using 2 Bounds Of Values? (+/- 300)

**URL:** <https://discuss.elastic.co/t/how-do-i-aggregate-with-percentile-rank-using-2-bounds-of-values-300/237092>\
**Category:** Kibana\
**Created:** [June 15, 2020, 8:45am UTC](https://discuss.elastic.co/t/how-do-i-aggregate-with-percentile-rank-using-2-bounds-of-values-300/237092 "2020-06-15T08:45:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ethan777100](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan777100/32/70366_2.png) [@Ethan777100](https://discuss.elastic.co/u/Ethan777100)\
**Post date:** [June 15, 2020, 8:45am UTC](https://discuss.elastic.co/t/how-do-i-aggregate-with-percentile-rank-using-2-bounds-of-values-300/237092/1 "2020-06-15T08:45:10Z")

</div>

I wish to aggregate my data set using percentile rank to show the % of values that are within +/-300 , grouped by their respective location.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/5/953416adfdcc8b1cf6a65704c35ef70e86ff7f08.png)

Today's percentile rank feature only seems to allow for case where you are below the set value - but there is no case to handle above the set value (especially for negative numbers)

![image](https://us1.discourse-cdn.com/elastic/original/3X/7/a/7a60ab05aa36360c813bce22415573d2214f0ab4.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:** [June 15, 2020, 7:04pm UTC](https://discuss.elastic.co/t/how-do-i-aggregate-with-percentile-rank-using-2-bounds-of-values-300/237092/2 "2020-06-15T19:04:01Z")

</div>

This is not how Elasticsearch calculates percentile ranks, so we can't support "above" the value: [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-rank-aggregation.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-rank-aggregation.html)

---

<div class="post-metadata">

**Author:** ![Ethan777100](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan777100/32/70366_2.png) [@Ethan777100](https://discuss.elastic.co/u/Ethan777100)\
**Post date:** [June 16, 2020, 1:43am UTC](https://discuss.elastic.co/t/how-do-i-aggregate-with-percentile-rank-using-2-bounds-of-values-300/237092/3 "2020-06-16T01:43:31Z")

</div>

will i still be able to pull of such a visualization?

i have alr digested the a/m guide before coming to ask on the forums.

---

<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 14, 2020, 1:55am UTC](https://discuss.elastic.co/t/how-do-i-aggregate-with-percentile-rank-using-2-bounds-of-values-300/237092/4 "2020-07-14T01:55:52Z")

</div>

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