<?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: Declaring an array within a query and adding elements to it as the query iterates in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Declaring-an-array-within-a-query-and-adding-elements-to-it-as/m-p/263604#M1476</link>
    <description>&lt;P&gt;Id sound line a need for use of &lt;EM&gt;&lt;STRONG&gt;collectArray&lt;/STRONG&gt; &lt;/EM&gt;or &lt;EM&gt;&lt;STRONG&gt;collectDistinct&lt;/STRONG&gt;&lt;/EM&gt; aggregation functions. Please take a look at example below (collection even integers) and result :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record(x=1),
  record(x=2),
  record(x=3),
  record(x=4),
  record(x=null)
| summarize {ax=arrayRemoveNulls(collectArray( if( x % 2==0, x )))}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1732553588034.png" style="width: 764px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/24833iD51646B609B894E5/image-dimensions/764x323?v=v2" width="764" height="323" role="button" title="krzysztof_hoja_0-1732553588034.png" alt="krzysztof_hoja_0-1732553588034.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be helpful if you could share your existing query.&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2024 16:54:30 GMT</pubDate>
    <dc:creator>krzysztof_hoja</dc:creator>
    <dc:date>2024-11-25T16:54:30Z</dc:date>
    <item>
      <title>Declaring an array within a query and adding elements to it as the query iterates</title>
      <link>https://community.dynatrace.com/t5/DQL/Declaring-an-array-within-a-query-and-adding-elements-to-it-as/m-p/263586#M1475</link>
      <description>&lt;P&gt;I am trying to&amp;nbsp;&lt;SPAN&gt;declare an array (of integers) within a query and add elements to it based on the result of an if condition, using one of the record columns in the query.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I am unable to do this or find any official support documentation to do so. Could I please know if it is possible and/or have a solution if it is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Javin&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 14:18:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Declaring-an-array-within-a-query-and-adding-elements-to-it-as/m-p/263586#M1475</guid>
      <dc:creator>Javin_Singh</dc:creator>
      <dc:date>2024-11-25T14:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Declaring an array within a query and adding elements to it as the query iterates</title>
      <link>https://community.dynatrace.com/t5/DQL/Declaring-an-array-within-a-query-and-adding-elements-to-it-as/m-p/263604#M1476</link>
      <description>&lt;P&gt;Id sound line a need for use of &lt;EM&gt;&lt;STRONG&gt;collectArray&lt;/STRONG&gt; &lt;/EM&gt;or &lt;EM&gt;&lt;STRONG&gt;collectDistinct&lt;/STRONG&gt;&lt;/EM&gt; aggregation functions. Please take a look at example below (collection even integers) and result :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record(x=1),
  record(x=2),
  record(x=3),
  record(x=4),
  record(x=null)
| summarize {ax=arrayRemoveNulls(collectArray( if( x % 2==0, x )))}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1732553588034.png" style="width: 764px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/24833iD51646B609B894E5/image-dimensions/764x323?v=v2" width="764" height="323" role="button" title="krzysztof_hoja_0-1732553588034.png" alt="krzysztof_hoja_0-1732553588034.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be helpful if you could share your existing query.&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 16:54:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Declaring-an-array-within-a-query-and-adding-elements-to-it-as/m-p/263604#M1476</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-11-25T16:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Declaring an array within a query and adding elements to it as the query iterates</title>
      <link>https://community.dynatrace.com/t5/DQL/Declaring-an-array-within-a-query-and-adding-elements-to-it-as/m-p/263649#M1480</link>
      <description>&lt;P&gt;Hi Kris,&lt;/P&gt;&lt;P&gt;Thank you, the collectArray() function was the bit I was missing.&lt;/P&gt;&lt;P&gt;Javin&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 09:14:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Declaring-an-array-within-a-query-and-adding-elements-to-it-as/m-p/263649#M1480</guid>
      <dc:creator>Javin_Singh</dc:creator>
      <dc:date>2024-11-26T09:14:07Z</dc:date>
    </item>
  </channel>
</rss>

