# timeseries avg($metric)

**URL:** <https://community.dynatrace.com/t/timeseries-avg-metric/45636>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed\
**Created:** [May 16, 2024, 8:30pm UTC](https://community.dynatrace.com/t/timeseries-avg-metric/45636 "2024-05-16T20:30:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [May 16, 2024, 8:30pm UTC](https://community.dynatrace.com/t/timeseries-avg-metric/45636/1 "2024-05-16T20:30:25Z")

</div>

Hello,

Var $metric is a existing metric, does anybody know how to make this work?

Or can this not de done?

KR Henk

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [May 20, 2024, 11:26am UTC](https://community.dynatrace.com/t/timeseries-avg-metric/45636/2 "2024-05-20T11:26:46Z")

</div>

Unfortunately value of variable (like $metric) is quoted string, so it will not work. But if you know the list of metrics you want to select from you can apply this pattern:

[https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243753#M830](https://community.dynatrace.com/post/243753#M830)

Kris
