<?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 DQL - get percentile of a value in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/DQL-get-percentile-of-a-value/m-p/264742#M1515</link>
    <description>&lt;P&gt;Hi DQLers, our tenant is strongly tag-oriented and we tagged almost each detected service with a key:value tag that allows us to assign each service to a specific application (and, in turn, to an application development team).&lt;/P&gt;
&lt;P&gt;We're now building a dashboard that acts as an application scorecard with some kpi for each application: managed calls, topology (calls, called by), error rate etc...&lt;/P&gt;
&lt;P&gt;I'd like to highlight the "weight" of this application among all monitored ones. So I'd like to measure the percentile of an application managed requests.&lt;/P&gt;
&lt;P&gt;Practical example. Let's say we have 100 different applications and their managed requests in a timeframe (sort descending):&lt;BR /&gt;App_ABC 10 000&lt;BR /&gt;App_XYZ 8 500&lt;BR /&gt;App_QWE 7 000&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;...&lt;/P&gt;
&lt;P&gt;App_ZXC 100&lt;/P&gt;
&lt;P&gt;For application App_XYZ I'd like to find DQL code to get that App_XYZ represents 2nd percentile of applications managed requests.&lt;/P&gt;
&lt;P&gt;How can I get this?&lt;/P&gt;
&lt;P&gt;I know I can get the value of any percentile but in this case I need to work on the other side.&lt;/P&gt;
&lt;P&gt;Any clue?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;BR /&gt;Paolo&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2024 07:02:49 GMT</pubDate>
    <dc:creator>paolo_fumanelli</dc:creator>
    <dc:date>2024-12-10T07:02:49Z</dc:date>
    <item>
      <title>DQL - get percentile of a value</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-get-percentile-of-a-value/m-p/264742#M1515</link>
      <description>&lt;P&gt;Hi DQLers, our tenant is strongly tag-oriented and we tagged almost each detected service with a key:value tag that allows us to assign each service to a specific application (and, in turn, to an application development team).&lt;/P&gt;
&lt;P&gt;We're now building a dashboard that acts as an application scorecard with some kpi for each application: managed calls, topology (calls, called by), error rate etc...&lt;/P&gt;
&lt;P&gt;I'd like to highlight the "weight" of this application among all monitored ones. So I'd like to measure the percentile of an application managed requests.&lt;/P&gt;
&lt;P&gt;Practical example. Let's say we have 100 different applications and their managed requests in a timeframe (sort descending):&lt;BR /&gt;App_ABC 10 000&lt;BR /&gt;App_XYZ 8 500&lt;BR /&gt;App_QWE 7 000&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;...&lt;/P&gt;
&lt;P&gt;App_ZXC 100&lt;/P&gt;
&lt;P&gt;For application App_XYZ I'd like to find DQL code to get that App_XYZ represents 2nd percentile of applications managed requests.&lt;/P&gt;
&lt;P&gt;How can I get this?&lt;/P&gt;
&lt;P&gt;I know I can get the value of any percentile but in this case I need to work on the other side.&lt;/P&gt;
&lt;P&gt;Any clue?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;BR /&gt;Paolo&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 07:02:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-get-percentile-of-a-value/m-p/264742#M1515</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2024-12-10T07:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: DQL - get percentile of a value</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-get-percentile-of-a-value/m-p/264853#M1516</link>
      <description>&lt;P&gt;I think what you are looking for is an index of application in an array of all applications sorter by number of requests. And this index should be expressed not as a absolute value, but as percentage vs. whole array size.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Such query on test data looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data
  record(application="App_ABC", requests=10000),
  record(application="App_XYZ", requests=8500),
  record(application="App_QWE", requests=7000),
  record(application="App_ZXC", requests=100)
| summarize { d=collectArray(record(requests, application)) } 
| fieldsAdd d = arraySort(d, direction:"descending")
| fieldsAdd d = d[][application]
| fieldsAdd p = arrayIndexOf(d,"App_XYZ")
| fieldsAdd p = 100.0*p/arraySize(d)&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-1733821062693.png" style="width: 829px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/25139i47F6994602EEB468/image-dimensions/829x462?v=v2" width="829" height="462" role="button" title="krzysztof_hoja_0-1733821062693.png" alt="krzysztof_hoja_0-1733821062693.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 08:59:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-get-percentile-of-a-value/m-p/264853#M1516</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-12-10T08:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: DQL - get percentile of a value</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-get-percentile-of-a-value/m-p/264897#M1521</link>
      <description>&lt;P&gt;That's great! It fits perfectly my use case. Thanks a lot&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 14:11:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-get-percentile-of-a-value/m-p/264897#M1521</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2024-12-10T14:11:05Z</dc:date>
    </item>
  </channel>
</rss>

