<?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: How to make a new Timeseries by calculating data from 2 individual Timeseries? in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/How-to-make-a-new-Timeseries-by-calculating-data-from-2/m-p/301203#M3397</link>
    <description>&lt;P&gt;In this case it can be simplified and &lt;EM&gt;&lt;STRONG&gt;lookup&lt;/STRONG&gt;&lt;/EM&gt; is not needed. With &lt;EM&gt;&lt;STRONG&gt;timeseries&lt;/STRONG&gt;&lt;/EM&gt; command you can retrieve multiple metrics in single command:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries { mem = avg(dt.host.memory.usage), cpu = avg(dt.host.cpu.usage) }, by: { dt.entity.host }, union: true
| fieldsAdd dt.entity.host.name = entityName(dt.entity.host)
| fieldsAdd cpu_mem = mem[] + cpu[]&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 25 Jun 2026 13:44:31 GMT</pubDate>
    <dc:creator>krzysztof_hoja</dc:creator>
    <dc:date>2026-06-25T13:44:31Z</dc:date>
    <item>
      <title>How to make a new Timeseries by calculating data from 2 individual Timeseries?</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-make-a-new-Timeseries-by-calculating-data-from-2/m-p/301188#M3395</link>
      <description>&lt;P&gt;As the PostgreSQL extension does not ingest the Cache Hit Ratio metrics, we have to do manual calculation with the following formula:&lt;/P&gt;&lt;P&gt;100 * blocks_hit / ( blocks_hit + blocks_read )&lt;/P&gt;&lt;P&gt;blocks_hit and blocks_read are 2 Timeseries and I want to use the above formula to calculate and make a new Timeseries for Cache Hit Ratio. Is it possible to do so?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2026 09:54:02 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-make-a-new-Timeseries-by-calculating-data-from-2/m-p/301188#M3395</guid>
      <dc:creator>Hillman</dc:creator>
      <dc:date>2026-06-25T09:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a new Timeseries by calculating data from 2 individual Timeseries?</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-make-a-new-Timeseries-by-calculating-data-from-2/m-p/301198#M3396</link>
      <description>&lt;P&gt;Yes, it is possible.&lt;/P&gt;&lt;P&gt;For example, I will paste here a DQL that sums up the values from %CPU and %MemUsage, using the lookup command ,&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/commands/correlation-and-join-commands#lookup" target="_blank" rel="noopener"&gt;https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/commands/correlation-and-join-commands#lookup&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries { mem = avg(dt.host.memory.usage) }, by: { dt.entity.host }
| fieldsAdd dt.entity.host.name = entityName(dt.entity.host)
| lookup [timeseries { cpu = avg(dt.host.cpu.usage) }, by: { dt.entity.host }
| fieldsAdd dt.entity.host.name = entityName(dt.entity.host)], sourceField:dt.entity.host, lookupField:dt.entity.host
| fieldsAdd cpu_mem = mem[] + lookup.cpu[]&lt;/LI-CODE&gt;&lt;P&gt;I am using the host name as matching field, so we calculate the right value for the right entity.&lt;/P&gt;&lt;P&gt;You can remove the original fields at the end, or configure it on visualization settings.&lt;/P&gt;&lt;P&gt;Try with your metrics and let us know.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2026 11:51:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-make-a-new-Timeseries-by-calculating-data-from-2/m-p/301198#M3396</guid>
      <dc:creator>dannemca</dc:creator>
      <dc:date>2026-06-25T11:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a new Timeseries by calculating data from 2 individual Timeseries?</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-make-a-new-Timeseries-by-calculating-data-from-2/m-p/301203#M3397</link>
      <description>&lt;P&gt;In this case it can be simplified and &lt;EM&gt;&lt;STRONG&gt;lookup&lt;/STRONG&gt;&lt;/EM&gt; is not needed. With &lt;EM&gt;&lt;STRONG&gt;timeseries&lt;/STRONG&gt;&lt;/EM&gt; command you can retrieve multiple metrics in single command:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries { mem = avg(dt.host.memory.usage), cpu = avg(dt.host.cpu.usage) }, by: { dt.entity.host }, union: true
| fieldsAdd dt.entity.host.name = entityName(dt.entity.host)
| fieldsAdd cpu_mem = mem[] + cpu[]&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Jun 2026 13:44:31 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-make-a-new-Timeseries-by-calculating-data-from-2/m-p/301203#M3397</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2026-06-25T13:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a new Timeseries by calculating data from 2 individual Timeseries?</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-make-a-new-Timeseries-by-calculating-data-from-2/m-p/301247#M3402</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/25373"&gt;@krzysztof_hoja&lt;/a&gt;&amp;nbsp;, &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/18264"&gt;@dannemca&lt;/a&gt;&amp;nbsp;, I am able to create a timeseries with the cache hit ratio!&lt;/P&gt;&lt;P&gt;I have got one more question. When I try to create a Single Value chart with the following DQL.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries { blocks_read = avg(postgres.blks_read.count), blocks_hit = avg(postgres.blks_hit.count) }, by: { device.name, database }, union: true
| fieldsAdd cache_hit_ratio = (100 * blocks_hit[] / (blocks_read[] + blocks_hit[]))
| fieldsAdd `Cache hit ratio` = arrayAvg(cache_hit_ratio)
| fieldsRemove interval&lt;/LI-CODE&gt;&lt;P&gt;I have found the sparkline cannot be displayed if I assign the timeseries cache_hit_ratio as the sparkline. Do you have any idea why does that happen?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hillman_0-1782456924091.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33544i0F8CF6C45A045C9C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hillman_0-1782456924091.png" alt="Hillman_0-1782456924091.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2026 06:57:03 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-make-a-new-Timeseries-by-calculating-data-from-2/m-p/301247#M3402</guid>
      <dc:creator>Hillman</dc:creator>
      <dc:date>2026-06-26T06:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a new Timeseries by calculating data from 2 individual Timeseries?</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-make-a-new-Timeseries-by-calculating-data-from-2/m-p/301272#M3403</link>
      <description>&lt;P&gt;That's because you removed the interval field. Comment/remove the last line and test again.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2026 14:26:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-make-a-new-Timeseries-by-calculating-data-from-2/m-p/301272#M3403</guid>
      <dc:creator>dannemca</dc:creator>
      <dc:date>2026-06-26T14:26:07Z</dc:date>
    </item>
  </channel>
</rss>

