# Calculate Percentile Time-Series by Request Attribute Using Dynatrace DQL

**URL:** <https://community.dynatrace.com/t/calculate-percentile-time-series-by-request-attribute-using-dynatrace-dql/53879>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed, notebooks\
**Created:** [October 27, 2025, 7:33pm UTC](https://community.dynatrace.com/t/calculate-percentile-time-series-by-request-attribute-using-dynatrace-dql/53879 "2025-10-27T19:33:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MychellSantos1](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@MychellSantos1](https://community.dynatrace.com/u/MychellSantos1)\
**Post date:** [October 27, 2025, 7:33pm UTC](https://community.dynatrace.com/t/calculate-percentile-time-series-by-request-attribute-using-dynatrace-dql/53879/1 "2025-10-27T19:33:48Z")

</div>

I have the following DQL query that calculates the **p50 response time per service** :

```markup
timeseries
p50 = percentile(dt.service.request.response_time, 50, default:0),
interval:10m, nonempty:true,
by: { dt.request_attribute_Key },
filter: matchesValue(`dt.entity.service`, "x"),
from: now()-1d,
to: now()
| fieldsAdd ServiceName = entityName(dt.entity.service)

```

Now I’d like to **add a dimension** based on a **request attribute** (for example request\_attribute.Key or request\_attribute.Type) — so I can see the percentile (p50) **per service and per request attribute value**.

Is it possible to define that kind of dimension in the timeseries clause, or do I need to expand the attribute first?  
If so, what would be the correct DQL syntax?

---

<div class="post-metadata">

**Author:** ![izabelarokita](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/izabelarokita/32/41812_2.png) [@izabelarokita](https://community.dynatrace.com/u/izabelarokita)\
**Post date:** [December 17, 2025, 10:01am UTC](https://community.dynatrace.com/t/calculate-percentile-time-series-by-request-attribute-using-dynatrace-dql/53879/2 "2025-12-17T10:01:15Z")

</div>

Hey&nbsp;[@MychellSantos1](https://community.dynatrace.com/user/97120)&nbsp;,  
I just wanted to check in and see if you still need help with this. If so, I’d be happy to look into it for you!&nbsp;:blush:  
Please let me know what works best for you.
