<?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 add a timeseries field in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/add-a-timeseries-field/m-p/281624#M2313</link>
    <description>&lt;P&gt;&amp;nbsp;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a simple dql example to ilustrate my issue&lt;/P&gt;&lt;P&gt;&lt;EM&gt;timeseries test=avg(dt.host.cpu.usage), by:{dt.entity.host}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| fieldsadd cpu_state=if(arrayAvg(test)&amp;gt;7,1,else:0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I would like to see history of cpu_state, but I always have one value (may be due to the arrayAvg). How can I see cpu state as a graph and see the value evolution?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jul 2025 08:21:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-07-16T08:21:46Z</dc:date>
    <item>
      <title>add a timeseries field</title>
      <link>https://community.dynatrace.com/t5/DQL/add-a-timeseries-field/m-p/281624#M2313</link>
      <description>&lt;P&gt;&amp;nbsp;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a simple dql example to ilustrate my issue&lt;/P&gt;&lt;P&gt;&lt;EM&gt;timeseries test=avg(dt.host.cpu.usage), by:{dt.entity.host}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| fieldsadd cpu_state=if(arrayAvg(test)&amp;gt;7,1,else:0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I would like to see history of cpu_state, but I always have one value (may be due to the arrayAvg). How can I see cpu state as a graph and see the value evolution?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 08:21:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/add-a-timeseries-field/m-p/281624#M2313</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-07-16T08:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: add a timeseries field</title>
      <link>https://community.dynatrace.com/t5/DQL/add-a-timeseries-field/m-p/281629#M2315</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;&lt;BR /&gt;I don't really understand what you want to do, could you elaborate a bit more on your use case and what you want to achieve?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 08:52:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/add-a-timeseries-field/m-p/281629#M2315</guid>
      <dc:creator>GerardJ</dc:creator>
      <dc:date>2025-07-16T08:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: add a timeseries field</title>
      <link>https://community.dynatrace.com/t5/DQL/add-a-timeseries-field/m-p/281638#M2317</link>
      <description>&lt;P&gt;Hi Gerard,&lt;BR /&gt;Of course&lt;BR /&gt;If I just create this dql&lt;BR /&gt;&lt;EM&gt;timeseries test=avg(dt.host.cpu.usage), by:{dt.entity.host}&lt;/EM&gt;&lt;BR /&gt;I get a graph of cpu usage evolution for each host based on the time windows I have selected in the dashboard.&lt;BR /&gt;Suppose now that I want to create a new&amp;nbsp; field named status on cpu usage wher rule is the following&lt;BR /&gt;if cpu_usage&amp;nbsp; is above 7 then state = 1&lt;/P&gt;&lt;P&gt;if cpu_usage is below 7 then state =0&lt;/P&gt;&lt;P&gt;I would like to display state graph based on the time windows I have selected in the dashboard.&lt;BR /&gt;How can I do that?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 09:43:01 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/add-a-timeseries-field/m-p/281638#M2317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-07-16T09:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: add a timeseries field</title>
      <link>https://community.dynatrace.com/t5/DQL/add-a-timeseries-field/m-p/281648#M2318</link>
      <description>&lt;P&gt;Ok I got it&lt;BR /&gt;So what you want is something like that :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GerardJ_0-1752666834392.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/29030iFED674F8D6A32043/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GerardJ_0-1752666834392.png" alt="GerardJ_0-1752666834392.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;here I use an iterative expression to compare each timeserie array value to the treshold&lt;BR /&gt;I choose to display it as a table for clarity but you can also use this state array in a graph&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GerardJ_3-1752667198370.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/29033i39AAF7F39049BC43/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GerardJ_3-1752667198370.png" alt="GerardJ_3-1752667198370.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There are other possibilities,&amp;nbsp;for display purposes for example i'd rather use the thresholds which have the advantage of being visual while preserving the true cpu values on the graph.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GerardJ_4-1752667518660.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/29034i7CFD6A46D020A29A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GerardJ_4-1752667518660.png" alt="GerardJ_4-1752667518660.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 12:07:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/add-a-timeseries-field/m-p/281648#M2318</guid>
      <dc:creator>GerardJ</dc:creator>
      <dc:date>2025-07-16T12:07:38Z</dc:date>
    </item>
  </channel>
</rss>

