# Percentile calculation

**URL:** <https://community.dynatrace.com/t/percentile-calculation/56154>\
**Category:** DQL\
**Tags:** dql\
**Created:** [June 11, 2026, 2:48pm UTC](https://community.dynatrace.com/t/percentile-calculation/56154 "2026-06-11T14:48:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![enrico\_afkl](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@enrico\_afkl](https://community.dynatrace.com/u/enrico_afkl)\
**Post date:** [June 11, 2026, 2:48pm UTC](https://community.dynatrace.com/t/percentile-calculation/56154/1 "2026-06-11T14:48:59Z")

</div>

Hello,  
I have this query and would like to find out which endpoints fall within the 98th percentile:

timeseries {  
totalCalls = sum(log.prgoffer.foapi.baminfo.httpmethod,  
filter: isNotNull(endpoint)),

successCalls = sum(log.prgoffer.foapi.baminfo.httpmethod,  
filter: isNotNull(endpoint)  
and matchesValue(baminfo.exception,“OK”)),

by:endpoint  
},

interval: 5m

| fieldsAdd successRatio = successCalls[] / totalCalls[] \* 100  
| fieldsRemove successCalls, totalCalls

thanks for all support 🙂 !

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [June 11, 2026, 11:43pm UTC](https://community.dynatrace.com/t/percentile-calculation/56154/2 "2026-06-11T23:43:53Z")

</div>

[@enrico\_afkl](https://community.dynatrace.com/user/98941)&nbsp;You can try the “arrayPercentile”, please see below

> **[Array functions](https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/array-functions)**
>
> A list of DQL array functions.

---

<div class="post-metadata">

**Author:** ![enrico\_afkl](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@enrico\_afkl](https://community.dynatrace.com/u/enrico_afkl)\
**Post date:** [June 24, 2026, 12:41pm UTC](https://community.dynatrace.com/t/percentile-calculation/56154/3 "2026-06-24T12:41:07Z")

</div>

Thank you very much! With this query, I now have the following:

timeseries total=avg(log.prgoffer.foapi.baminfo.soap.duration) by: {baminfo.provider}  
| fieldsAdd p99 = arrayPercentile(total, 99)  
| fieldsRemove timeframe, interval, total

A chart showing the 99th percentile by category.

 ![enrico_afkl_0-1782304845962.png](https://global.discourse-cdn.com/dynatrace/original/2X/9/9820a0866d2630e05e17c945efe1c2603880cbf6.png)

Is it possible to see how the P99 has changed over time for each provider? (Using a line chart)

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [June 25, 2026, 12:40am UTC](https://community.dynatrace.com/t/percentile-calculation/56154/4 "2026-06-25T00:40:02Z")

</div>

[@enrico\_afkl](https://community.dynatrace.com/user/98941)&nbsp; Yes, you might need to modify the DQL a bit, please try the below

```markup
timeseries p99=percentile(log.prgoffer.foapi.baminfo.soap.duration, 99) , by: { baminfo.provider }

```

---

<div class="post-metadata">

**Author:** ![enrico\_afkl](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@enrico\_afkl](https://community.dynatrace.com/u/enrico_afkl)\
**Post date:** [June 25, 2026, 6:54am UTC](https://community.dynatrace.com/t/percentile-calculation/56154/5 "2026-06-25T06:54:48Z")

</div>

I and thanks for your answer 🙂  
I thought that was the right solution but when I tried I had “no records” answer whereas with the previous query I do have values within the same range so&nbsp;I am puzzled.

 ![enrico_afkl_0-1782370478410.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/2/120065cdcdaca7b4c8edaa58b1ccb08b2c826328.png)

do you understand why?

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [June 25, 2026, 7:09am UTC](https://community.dynatrace.com/t/percentile-calculation/56154/6 "2026-06-25T07:09:03Z")

</div>

[@enrico\_afkl](https://community.dynatrace.com/user/98941)&nbsp;The data that you are querying , is that a timeseries data? What if you try to get a average , do you see data?

```markup
timeseries avg(log.prgoffer.foapi.baminfo.soap.duration) , by: { baminfo.provider }

```

---

<div class="post-metadata">

**Author:** ![enrico\_afkl](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@enrico\_afkl](https://community.dynatrace.com/u/enrico_afkl)\
**Post date:** [June 25, 2026, 7:35am UTC](https://community.dynatrace.com/t/percentile-calculation/56154/7 "2026-06-25T07:35:34Z")

</div>

I did this for the first query, but now i would like to have the evolution in time with a line chart

---

<div class="post-metadata">

**Author:** ![enrico\_afkl](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@enrico\_afkl](https://community.dynatrace.com/u/enrico_afkl)\
**Post date:** [July 15, 2026, 8:14am UTC](https://community.dynatrace.com/t/percentile-calculation/56154/8 "2026-07-15T08:14:30Z")

</div>

any idea?

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [July 16, 2026, 5:53am UTC](https://community.dynatrace.com/t/percentile-calculation/56154/9 "2026-07-16T05:53:43Z")

</div>

[@enrico\_afkl](https://community.dynatrace.com/user/98941)&nbsp;Earlier DQL should work for line chart , you just need to change the visualization . Could you please elaborate the issue you are facing for better understanding ?

---

<div class="post-metadata">

**Author:** ![enrico\_afkl](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@enrico\_afkl](https://community.dynatrace.com/u/enrico_afkl)\
**Post date:** [July 16, 2026, 7:16am UTC](https://community.dynatrace.com/t/percentile-calculation/56154/10 "2026-07-16T07:16:54Z")

</div>

hello&nbsp;[@p\_devulapalli](https://community.dynatrace.com/user/21657)&nbsp;,  
I vcan see data but I’d like to have percentile and not just the average

 ![enrico_afkl_0-1784186158518.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/7/87cc6353cd9b321b21caf0e7f5502bea10fccdd9.png)

thanks a lot for your help

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [July 17, 2026, 12:43am UTC](https://community.dynatrace.com/t/percentile-calculation/56154/11 "2026-07-17T00:43:36Z")

</div>

[@enrico\_afkl](https://community.dynatrace.com/user/98941)&nbsp;I am bit unsure why you are not able to see the data for percentile, it should display similar to average . Please open up a ticket with support, they might be able to guide you correctly.

---

<div class="post-metadata">

**Author:** ![enrico\_afkl](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@enrico\_afkl](https://community.dynatrace.com/u/enrico_afkl)\
**Post date:** [July 17, 2026, 7:09am UTC](https://community.dynatrace.com/t/percentile-calculation/56154/12 "2026-07-17T07:09:39Z")

</div>

thanks, I did it
