<?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 Recreate the data explorer chart session by means of the new dashboard in Grail in Dashboarding</title>
    <link>https://community.dynatrace.com/t5/Dashboarding/Recreate-the-data-explorer-chart-session-by-means-of-the-new/m-p/224817#M3323</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi everyone,&lt;BR /&gt;is that possible to recreate the chart made in the data explorer session by means of the new dashboard in grail?&lt;BR /&gt;The querry that i'm using is this:&lt;BR /&gt;&lt;EM&gt;calc:service.autorizzatorerequestcount:splitBy("Dimension"):sort(value(auto,descending)):limit(20)&lt;/EM&gt;&lt;BR /&gt;where &lt;STRONG&gt;autorizzatorerequestcount&lt;/STRONG&gt; is a custom metric splitter by the dimension &lt;STRONG&gt;Dimension&lt;/STRONG&gt;...&lt;BR /&gt;Obtaining this graph:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andreaCaria_0-1696846253466.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/14483i2770C5B0131931D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="andreaCaria_0-1696846253466.png" alt="andreaCaria_0-1696846253466.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I can't find any DQL that fetch those data, is there any way to achive such result?&lt;BR /&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Andrea&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2024 11:44:58 GMT</pubDate>
    <dc:creator>andreaCaria</dc:creator>
    <dc:date>2024-01-24T11:44:58Z</dc:date>
    <item>
      <title>Recreate the data explorer chart session by means of the new dashboard in Grail</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Recreate-the-data-explorer-chart-session-by-means-of-the-new/m-p/224817#M3323</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi everyone,&lt;BR /&gt;is that possible to recreate the chart made in the data explorer session by means of the new dashboard in grail?&lt;BR /&gt;The querry that i'm using is this:&lt;BR /&gt;&lt;EM&gt;calc:service.autorizzatorerequestcount:splitBy("Dimension"):sort(value(auto,descending)):limit(20)&lt;/EM&gt;&lt;BR /&gt;where &lt;STRONG&gt;autorizzatorerequestcount&lt;/STRONG&gt; is a custom metric splitter by the dimension &lt;STRONG&gt;Dimension&lt;/STRONG&gt;...&lt;BR /&gt;Obtaining this graph:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andreaCaria_0-1696846253466.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/14483i2770C5B0131931D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="andreaCaria_0-1696846253466.png" alt="andreaCaria_0-1696846253466.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I can't find any DQL that fetch those data, is there any way to achive such result?&lt;BR /&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Andrea&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 11:44:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Recreate-the-data-explorer-chart-session-by-means-of-the-new/m-p/224817#M3323</guid>
      <dc:creator>andreaCaria</dc:creator>
      <dc:date>2024-01-24T11:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Data explorer chart into DQL</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Recreate-the-data-explorer-chart-session-by-means-of-the-new/m-p/231749#M3516</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/63636"&gt;@andreaCaria&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Have you already found the answer to your questions? Let me know; if not, I'll look for someone to help. And if yes - maybe you would like to share the solution with the Community? &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 12:22:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Recreate-the-data-explorer-chart-session-by-means-of-the-new/m-p/231749#M3516</guid>
      <dc:creator>IzabelaRokita</dc:creator>
      <dc:date>2023-12-13T12:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Data explorer chart into DQL</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Recreate-the-data-explorer-chart-session-by-means-of-the-new/m-p/233373#M3586</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/63636"&gt;@andreaCaria&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;Calculated Service metrics are not available in Grail as of yet but will be in the future.&lt;/P&gt;&lt;P&gt;These are the current metrics, but you can get these from our API if required -&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/observe-and-explore/metrics/built-in-metrics-on-grail" target="_blank" rel="noopener"&gt;https://docs.dynatrace.com/docs/observe-and-explore/metrics/built-in-metrics-on-grail&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.dynatrace.com/reference/sdks/client-classic-environment-v2/#query" target="_blank" rel="noopener"&gt;SDK - https://developer.dynatrace.com/reference/sdks/client-classic-environment-v2/#query&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This JavaScript snippet below will give you the sum of your Calculated Service Metric in a single value. You can tweak the JavaScript to your needs as required:&lt;/P&gt;&lt;PRE&gt;import { metricsClient } from '@dynatrace-sdk/client-classic-environment-v2';

// Function to calculate the sum of numbers within values, replacing nulls with 0
function calculateSumOfValues(data) {
  let totalSum = 0;

  data.forEach(service =&amp;gt; {
    service.values.forEach(value =&amp;gt; {
      totalSum += value !== null ? value : 0;
    });
  });

  return totalSum;
}

export default async function fetchMetrics() {
  // Assuming dt_timeframe_from holds the timeframe from your site

  const queryParameters = {
    acceptType: "application/json; charset=utf-8",
    metricSelector: "**********", //Amend to your Advanced Data Explorer Query
    from: $dt_timeframe_from, // Using template literal to interpolate the variable
    resolution: "10m"
    // Add other parameters as needed: entitySelector, to, etc.
  };

  try {
    const data = await metricsClient.query(queryParameters);
    
    // Calculate the sum of numbers within values, replacing nulls with 0
    const totalSum = calculateSumOfValues(data.result[0].data);
    
    console.log("Total sum of values:", totalSum); // Output the total sum
    
    // Returning the fetched data and the totalSum with the name "totalSum"
    return { data, totalSum };
  } catch (error) {
    // Handle the error gracefully
    console.error("Error fetching metrics:", error);
    throw error;
  }
}&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Lawrence&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 13:51:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Recreate-the-data-explorer-chart-session-by-means-of-the-new/m-p/233373#M3586</guid>
      <dc:creator>LawrenceBarratt</dc:creator>
      <dc:date>2024-01-04T13:51:56Z</dc:date>
    </item>
  </channel>
</rss>

