<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Function replace by variable (dropdown selection) in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243815#M831</link>
    <description>&lt;P&gt;Hero! Works for me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Made a small correction to the operators.&lt;/P&gt;&lt;P&gt;timeseries {&lt;BR /&gt;avg_diskusage = avg(dt.host.disk.used.percent),&lt;BR /&gt;min_diskusage = min(dt.host.disk.used.percent),&lt;BR /&gt;max_diskusage = max(dt.host.disk.used.percent) },&lt;/P&gt;&lt;P&gt;Thank you so much!!!!&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2024 11:20:40 GMT</pubDate>
    <dc:creator>marina_pollehn</dc:creator>
    <dc:date>2024-04-24T11:20:40Z</dc:date>
    <item>
      <title>Function replace by variable (dropdown selection)</title>
      <link>https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243710#M829</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Possible options are: min, max, avg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries diskusage = avg(dt.host.disk.used.percent), by:{dt.entity.host,dt.entity.disk}, interval:1d&lt;/LI-CODE&gt;&lt;P&gt;Any suggestions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/2456"&gt;@marina_pollehn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 14:02:47 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243710#M829</guid>
      <dc:creator>wbolten</dc:creator>
      <dc:date>2024-04-23T14:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Function replace by variable (dropdown selection)</title>
      <link>https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243753#M830</link>
      <description>&lt;P&gt;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:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries {
avg_diskusage = avg(dt.host.disk.used.percent), 
min_diskusage = avg(dt.host.disk.used.percent), 
max_diskusage = avg(dt.host.disk.used.percent) },
by:{dt.entity.host,dt.entity.disk}, interval:1d
| fields diskusage=coalesce( 
    if($function=="max", max_diskusage),
    if($function=="min", min_diskusage),
    avg_diskusage ), interval, timeframe, dt.entity.host, dt.entity.disk&lt;/LI-CODE&gt;&lt;P&gt;together with this definition of variable:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1713904731815.png" style="width: 850px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/19367i1630DCDD37314973/image-dimensions/850x323?v=v2" width="850" height="323" role="button" title="krzysztof_hoja_0-1713904731815.png" alt="krzysztof_hoja_0-1713904731815.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 20:41:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243753#M830</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-04-23T20:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Function replace by variable (dropdown selection)</title>
      <link>https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243815#M831</link>
      <description>&lt;P&gt;Hero! Works for me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Made a small correction to the operators.&lt;/P&gt;&lt;P&gt;timeseries {&lt;BR /&gt;avg_diskusage = avg(dt.host.disk.used.percent),&lt;BR /&gt;min_diskusage = min(dt.host.disk.used.percent),&lt;BR /&gt;max_diskusage = max(dt.host.disk.used.percent) },&lt;/P&gt;&lt;P&gt;Thank you so much!!!!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 11:20:40 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243815#M831</guid>
      <dc:creator>marina_pollehn</dc:creator>
      <dc:date>2024-04-24T11:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Function replace by variable (dropdown selection)</title>
      <link>https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243819#M832</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/25373"&gt;@krzysztof_hoja&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an excellent work around and exactly what we needed.&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/2456"&gt;@marina_pollehn&lt;/a&gt;&amp;nbsp;already adjusted the panel on our side and it is working as expected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 12:44:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243819#M832</guid>
      <dc:creator>wbolten</dc:creator>
      <dc:date>2024-04-24T12:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Function replace by variable (dropdown selection)</title>
      <link>https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243832#M833</link>
      <description>&lt;P&gt;Thx for correction. "ctrl-c" + "ctrl-v"&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 14:41:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Function-replace-by-variable-dropdown-selection/m-p/243832#M833</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-04-24T14:41:56Z</dc:date>
    </item>
  </channel>
</rss>

