Showing results for 
Show  only  | Search instead for 
Did you mean: 

Function replace by variable (dropdown selection)



I have a panel with the below timeseries command and it is working. However they would like to be able to change from avg to max, or other ones for that matter and without the need to change the DQL everytime in the panel. 

I am doing a similar thing with dropdown values on the dashboard for the threshold of the disk usage. Doing the same for the avg to change it to max is not working. 

Possible options are: min, max, avg


timeseries diskusage = avg(, by:{,dt.entity.disk}, interval:1d

Any suggestions? 




Dynatrace Advisor
Dynatrace Advisor

Variable value is a quoted string, so it is not possible to use it as a command or function in the query, but you can check such query:

timeseries {
avg_diskusage = avg(, 
min_diskusage = avg(, 
max_diskusage = avg( },
by:{,dt.entity.disk}, interval:1d
| fields diskusage=coalesce( 
    if($function=="max", max_diskusage),
    if($function=="min", min_diskusage),
    avg_diskusage ), interval, timeframe,, dt.entity.disk

together with this definition of variable:





Hero! Works for me 🙂 Made a small correction to the operators.

timeseries {
avg_diskusage = avg(,
min_diskusage = min(,
max_diskusage = max( },

Thank you so much!!!!

A Dynatrace Professional nerd working for Conclusion Xforce

Thx for correction. "ctrl-c" + "ctrl-v" 😉


Hi @krzysztof_hoja 

This is an excellent work around and exactly what we needed. @marina_pollehn already adjusted the panel on our side and it is working as expected. 

Thank you. 

Featured Posts