<?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 Average of 2 arrays by a field in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Average-of-2-arrays-by-a-field/m-p/260818#M1372</link>
    <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;Having the following query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries value = avg(dt.cloud.azure.vm.cpu_usage), by: {azure.location, azure.management_group, azure.resource.name, azure.subscription, azure.vm_scale_set.name, dt.entity.azure_region, dt.entity.azure_vm, dt.source_entity, dt.source_entity.type}
| filter contains(azure.resource.name, "primary00") or contains(azure.resource.name, "primary01")
| parse azure.resource.name, "LD 'primary0' INT:number"&lt;/LI-CODE&gt;&lt;P&gt;I'd like to get in a timeseries the average of the arrays by number. Meaning, for all arrays with number==0, an average of the values of the arrays and the same for number==1.&lt;/P&gt;&lt;P&gt;How could I achieve this? arrayAvg doesn't seem to work for this use case.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Mon, 28 Oct 2024 09:52:50 GMT</pubDate>
    <dc:creator>elenaperez</dc:creator>
    <dc:date>2024-10-28T09:52:50Z</dc:date>
    <item>
      <title>Average of 2 arrays by a field</title>
      <link>https://community.dynatrace.com/t5/DQL/Average-of-2-arrays-by-a-field/m-p/260818#M1372</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;Having the following query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries value = avg(dt.cloud.azure.vm.cpu_usage), by: {azure.location, azure.management_group, azure.resource.name, azure.subscription, azure.vm_scale_set.name, dt.entity.azure_region, dt.entity.azure_vm, dt.source_entity, dt.source_entity.type}
| filter contains(azure.resource.name, "primary00") or contains(azure.resource.name, "primary01")
| parse azure.resource.name, "LD 'primary0' INT:number"&lt;/LI-CODE&gt;&lt;P&gt;I'd like to get in a timeseries the average of the arrays by number. Meaning, for all arrays with number==0, an average of the values of the arrays and the same for number==1.&lt;/P&gt;&lt;P&gt;How could I achieve this? arrayAvg doesn't seem to work for this use case.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 09:52:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Average-of-2-arrays-by-a-field/m-p/260818#M1372</guid>
      <dc:creator>elenaperez</dc:creator>
      <dc:date>2024-10-28T09:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Average of 2 arrays by a field</title>
      <link>https://community.dynatrace.com/t5/DQL/Average-of-2-arrays-by-a-field/m-p/263116#M1455</link>
      <description>&lt;P&gt;You need to use integrative expressions in &lt;EM&gt;&lt;STRONG&gt;summary&lt;/STRONG&gt; &lt;/EM&gt;command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries value = avg(dt.cloud.azure.vm.cpu_usage), 
  by: {azure.location, azure.management_group, azure.resource.name, azure.subscription, azure.vm_scale_set.name, 
  dt.entity.azure_region, dt.entity.azure_vm, dt.source_entity, dt.source_entity.type}
| filter contains(azure.resource.name, "primary00") or contains(azure.resource.name, "primary01")
| parse azure.resource.name, "LD 'primary0' INT:number"
| summarize {value=avg(value[])}, by: {interval, timeframe, number}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This query will give 2 timeseries for 2 possible values of "number". Of course you can split data as you with by adding more of available dimensions retrieved by &lt;EM&gt;&lt;STRONG&gt;timeseries&lt;/STRONG&gt; &lt;/EM&gt;command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please also take a look a other examples in our documentation:&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/analyze-explore-automate/metrics/dql-examples#example-17-split-cpu-usage-by-kubernetes-annotations" target="_blank"&gt;https://docs.dynatrace.com/docs/analyze-explore-automate/metrics/dql-examples#example-17-split-cpu-usage-by-kubernetes-annotations&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 20:41:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Average-of-2-arrays-by-a-field/m-p/263116#M1455</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-11-20T20:41:11Z</dc:date>
    </item>
  </channel>
</rss>

