<?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: Is there a way to get row_number () or any function to generate sequential number in DQL ? in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Is-there-a-way-to-get-row-number-or-any-function-to-generate/m-p/267231#M1599</link>
    <description>&lt;P&gt;You can generate table with indexes if you have your data in form of timeseries using &lt;EM&gt;iIndex()&lt;/EM&gt; function in iterative expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share your query end explain where/why you want to "number" you data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jan 2025 13:12:22 GMT</pubDate>
    <dc:creator>krzysztof_hoja</dc:creator>
    <dc:date>2025-01-13T13:12:22Z</dc:date>
    <item>
      <title>Is there a way to get row_number () or any function to generate sequential number in DQL ?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-there-a-way-to-get-row-number-or-any-function-to-generate/m-p/266929#M1587</link>
      <description>&lt;P&gt;Is there a way to get row_number () or any function to generate sequential number in DQL ?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 17:23:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-there-a-way-to-get-row-number-or-any-function-to-generate/m-p/266929#M1587</guid>
      <dc:creator>susmita_k</dc:creator>
      <dc:date>2025-01-08T17:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get row_number () or any function to generate sequential number in DQL ?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-there-a-way-to-get-row-number-or-any-function-to-generate/m-p/267231#M1599</link>
      <description>&lt;P&gt;You can generate table with indexes if you have your data in form of timeseries using &lt;EM&gt;iIndex()&lt;/EM&gt; function in iterative expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share your query end explain where/why you want to "number" you data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 13:12:22 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-there-a-way-to-get-row-number-or-any-function-to-generate/m-p/267231#M1599</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-01-13T13:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get row_number () or any function to generate sequential number in DQL ?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-there-a-way-to-get-row-number-or-any-function-to-generate/m-p/267234#M1600</link>
      <description>&lt;P&gt;Thank you. Here is the DQL&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;fetch dt.entity.host&lt;BR /&gt;| fieldsAdd managementZones&lt;BR /&gt;| expand managementZones&lt;BR /&gt;| filter managementZones == "mz_prod"&amp;nbsp;&lt;BR /&gt;|expand tags&lt;BR /&gt;  |parse tags, """((LD:tag (!&amp;lt;&amp;lt;'\\' ':') LD:value)|LD:tag)"""&lt;BR /&gt;  |filter tag == "AppName"&amp;nbsp;&lt;BR /&gt;|fieldsAdd AppName = value&lt;BR /&gt;|filter AppName == "App1"&lt;BR /&gt;|fieldsAdd&amp;nbsp; pm=ceil(toDouble(physicalMemory)/1000000000)&lt;BR /&gt;|fields AppName, entity.name,&amp;nbsp;&amp;nbsp; pm&lt;BR /&gt;|summarize d=collectArray(record(AppName, entity.name,&amp;nbsp;&amp;nbsp; pm))&lt;BR /&gt;|fields a = record(value = d[], index = iIndex())&lt;BR /&gt;|expand a&lt;BR /&gt;|fields test =a[value], index = a[index]&lt;BR /&gt;|fields AppName=test[AppName],entity.name=test[entity.name],pm=test[pm],index&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I need the index (sequence #) to compare with hosts of another Management zone for the same appName.&lt;/P&gt;&lt;P&gt;Can you please suggest, how can I create a timeseries out of this result ? Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 13:42:44 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-there-a-way-to-get-row-number-or-any-function-to-generate/m-p/267234#M1600</guid>
      <dc:creator>susmita_k</dc:creator>
      <dc:date>2025-01-13T13:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get row_number () or any function to generate sequential number in DQL ?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-there-a-way-to-get-row-number-or-any-function-to-generate/m-p/267283#M1601</link>
      <description>&lt;P&gt;I used word "timeseries", while I should use just "array".&amp;nbsp;I see that you successfully used iIndex() function to get entity numbering.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I rewrote the query, so it can work on my test environment (adjusted filters) and did some simplification/compressions of syntax (use of &lt;EM&gt;&lt;STRONG&gt;expand&lt;/STRONG&gt; &lt;/EM&gt;can be avoided )&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.host
| filter iAny(managementZones[]=="HipsterShopLogs")

| fieldsAdd ptags = parse(tags[], """('[' LD:context ']')?((LD:tag (!&amp;lt;&amp;lt;'\\' ':') LD:value)|LD:tag)""")
| fieldsAdd ptags = record(context=ptags[][context], tag=replaceString(ptags[][tag],"\\:",":"), 
  value=replaceString(ptags[][value],"\\:",":"), orig=tags[] )

| filter iAny(ptags[][tag]=="dt.cost.costcenter" and ptags[][value]=="business-intelligence/BI") 

| fieldsAdd  pm=ceil(toDouble(physicalMemory)/1000000000)
| summarize d=collectArray(record(AppName=arrayFirst(iCollectArray(if(ptags[][tag]=="dt.cost.costcenter",ptags[])))[value] , entity.name, pm))
| fields a = record(value = d[], index = iIndex())
| expand a
| fields index = a[index], AppName=a[value][AppName],entity.name=a[value][entity.name], pm=a[value][pm]&lt;/LI-CODE&gt;&lt;P&gt;and my result of a query looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1736788342653.png" style="width: 746px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/25692i161A35B3D1E0B0F8/image-dimensions/746x388?v=v2" width="746" height="388" role="button" title="krzysztof_hoja_0-1736788342653.png" alt="krzysztof_hoja_0-1736788342653.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you have similar query for a different MZ comparing result sets is possible of, but what is the desired criteria of comparison? And what is the role of the index in it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 17:15:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-there-a-way-to-get-row-number-or-any-function-to-generate/m-p/267283#M1601</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-01-13T17:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get row_number () or any function to generate sequential number in DQL ?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-there-a-way-to-get-row-number-or-any-function-to-generate/m-p/267285#M1602</link>
      <description>&lt;P&gt;I am able to compare the memories of each hosts from different mz ( same app running in model and prod and we would like to compare the memory/cpu configuration in both the environment). I am looking to create a timeseries so I can configure the alert in davis AI anomaly detector and the concerned team will be notified when there is a mismatch found.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 17:45:26 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-there-a-way-to-get-row-number-or-any-function-to-generate/m-p/267285#M1602</guid>
      <dc:creator>susmita_k</dc:creator>
      <dc:date>2025-01-13T17:45:26Z</dc:date>
    </item>
  </channel>
</rss>

