<?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 Remove Duplicate Entries in Custom Metric Data Using DQL in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Remove-Duplicate-Entries-in-Custom-Metric-Data-Using-DQL/m-p/282664#M2393</link>
    <description>&lt;P&gt;&lt;STRONG&gt;How can I eliminate duplications in DQL when working with timeseries custom metric data filtered by conditions?&lt;/STRONG&gt;&lt;BR /&gt;USECASE: Loading Custom metrics in below query 10 times in timeseries is killing DQL Storage bucket. I attempted to use variables to reuse the metric, but it didn’t help—each usage resulted in new data buckets being created. This caused the query to explode to over &lt;STRONG&gt;500 million data points Error from Dynatrace Limitations,&lt;/STRONG&gt; even though the source dataset only contains 43,000 records with 11 columns in the table.&lt;/P&gt;
&lt;P&gt;For Above Query Nothing worked for me: Tried variables, Problems i faced is :&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;can’t fetch a metric once and reuse it with conditional logic applying filters.&lt;/LI&gt;
&lt;LI&gt;can’t assign a timeseries result to a variable inside fetch.&lt;/LI&gt;
&lt;LI&gt;can’t use let to define reusable filters inside fetch.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Query is :&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;timeseries METRIC_A_approved = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeA" AND&lt;BR /&gt;(responseCode == "0" OR responseCode == "00") AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_A_total = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeA" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_A_total }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_approved = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(responseCode == "0" OR responseCode == "00") AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_approved }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_total = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_total }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_approved_subgroup = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(responseCode == "0" OR responseCode == "00") AND&lt;BR /&gt;(categoryCode in ["1001", "1002", "1003", "1004", "1005"]) AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_approved_subgroup }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_total_subgroup = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(categoryCode in ["1001", "1002", "1003", "1004", "1005"]) AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_total_subgroup }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_approved_domestic = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(responseCode == "0" OR responseCode == "00") AND&lt;BR /&gt;categoryCode == "2001" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_approved_domestic }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_total_domestic = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;categoryCode == "2001" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_total_domestic }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_approved_crossborder = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(responseCode == "0" OR responseCode == "00") AND&lt;BR /&gt;categoryCode == "2002" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_approved_crossborder }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_total_crossborder = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;categoryCode == "2002" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_total_crossborder }, kind: outer&lt;/P&gt;
&lt;P&gt;| fieldsAdd&lt;BR /&gt;Rate_A = if(coalesce(METRIC_A_total, 0) == 0, 0, 100 * coalesce(METRIC_A_approved, 0) / coalesce(METRIC_A_total, 0)),&lt;BR /&gt;Rate_B = if(coalesce(METRIC_B_total, 0) == 0, 0, 100 * coalesce(METRIC_B_approved, 0) / coalesce(METRIC_B_total, 0)),&lt;BR /&gt;Rate_B_subgroup = if(coalesce(METRIC_B_total_subgroup, 0) == 0, 0, 100 * coalesce(METRIC_B_approved_subgroup, 0) / coalesce(METRIC_B_total_subgroup, 0)),&lt;BR /&gt;Rate_B_domestic = if(coalesce(METRIC_B_total_domestic, 0) == 0, 0, 100 * coalesce(METRIC_B_approved_domestic, 0) / coalesce(METRIC_B_total_domestic, 0)),&lt;BR /&gt;Rate_B_crossborder = if(coalesce(METRIC_B_total_crossborder, 0) == 0, 0, 100 * coalesce(METRIC_B_approved_crossborder, 0) / coalesce(METRIC_B_total_crossborder, 0))&lt;/P&gt;
&lt;P&gt;| filter not(isNull(entity) or entity == "")&lt;BR /&gt;| fieldsAdd&lt;BR /&gt;Entity = entity,&lt;BR /&gt;A.Total = toLong(coalesce(METRIC_A_total, 0)),&lt;BR /&gt;A.Rate = concat(toString(round(coalesce(Rate_A, 0), decimals: 2)), "%"),&lt;BR /&gt;B.Total = toLong(coalesce(METRIC_B_total, 0)),&lt;BR /&gt;B.Rate = concat(toString(round(coalesce(Rate_B, 0), decimals: 2)), "%"),&lt;BR /&gt;B.Total.Sub = toLong(coalesce(METRIC_B_total_subgroup, 0)),&lt;BR /&gt;B.Rate.Sub = concat(toString(round(coalesce(Rate_B_subgroup, 0), decimals: 2)), "%"),&lt;BR /&gt;B.Total.Dom = toLong(coalesce(METRIC_B_total_domestic, 0)),&lt;BR /&gt;B.Rate.Dom = concat(toString(round(coalesce(Rate_B_domestic, 0), decimals: 2)), "%"),&lt;BR /&gt;B.Total.XB = toLong(coalesce(METRIC_B_total_crossborder, 0)),&lt;BR /&gt;B.Rate.XB = concat(toString(round(coalesce(Rate_B_crossborder, 0), decimals: 2)), "%")&lt;/P&gt;
&lt;P&gt;| fields Entity, A.Total, A.Rate, B.Total, B.Rate, B.Total.Dom, B.Rate.Dom, B.Total.XB, B.Rate.XB, B.Total.Sub, B.Rate.Sub&lt;BR /&gt;| sort A.Rate desc&lt;/P&gt;</description>
    <pubDate>Wed, 17 Dec 2025 10:26:06 GMT</pubDate>
    <dc:creator>knallapa</dc:creator>
    <dc:date>2025-12-17T10:26:06Z</dc:date>
    <item>
      <title>Remove Duplicate Entries in Custom Metric Data Using DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Remove-Duplicate-Entries-in-Custom-Metric-Data-Using-DQL/m-p/282664#M2393</link>
      <description>&lt;P&gt;&lt;STRONG&gt;How can I eliminate duplications in DQL when working with timeseries custom metric data filtered by conditions?&lt;/STRONG&gt;&lt;BR /&gt;USECASE: Loading Custom metrics in below query 10 times in timeseries is killing DQL Storage bucket. I attempted to use variables to reuse the metric, but it didn’t help—each usage resulted in new data buckets being created. This caused the query to explode to over &lt;STRONG&gt;500 million data points Error from Dynatrace Limitations,&lt;/STRONG&gt; even though the source dataset only contains 43,000 records with 11 columns in the table.&lt;/P&gt;
&lt;P&gt;For Above Query Nothing worked for me: Tried variables, Problems i faced is :&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;can’t fetch a metric once and reuse it with conditional logic applying filters.&lt;/LI&gt;
&lt;LI&gt;can’t assign a timeseries result to a variable inside fetch.&lt;/LI&gt;
&lt;LI&gt;can’t use let to define reusable filters inside fetch.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Query is :&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;timeseries METRIC_A_approved = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeA" AND&lt;BR /&gt;(responseCode == "0" OR responseCode == "00") AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_A_total = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeA" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_A_total }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_approved = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(responseCode == "0" OR responseCode == "00") AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_approved }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_total = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_total }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_approved_subgroup = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(responseCode == "0" OR responseCode == "00") AND&lt;BR /&gt;(categoryCode in ["1001", "1002", "1003", "1004", "1005"]) AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_approved_subgroup }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_total_subgroup = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(categoryCode in ["1001", "1002", "1003", "1004", "1005"]) AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_total_subgroup }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_approved_domestic = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(responseCode == "0" OR responseCode == "00") AND&lt;BR /&gt;categoryCode == "2001" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_approved_domestic }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_total_domestic = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;categoryCode == "2001" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_total_domestic }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_approved_crossborder = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;(responseCode == "0" OR responseCode == "00") AND&lt;BR /&gt;categoryCode == "2002" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_approved_crossborder }, kind: outer&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries METRIC_B_total_crossborder = sum(&lt;BR /&gt;`custom.app-metrics.transaction.data`,&lt;BR /&gt;scalar: true,&lt;BR /&gt;filter: {&lt;BR /&gt;txType == "TypeB" AND&lt;BR /&gt;categoryCode == "2002" AND&lt;BR /&gt;(isNull($Entity) OR $Entity == "" OR entity == $Entity)&lt;BR /&gt;}&lt;BR /&gt;), by: { entity }&lt;BR /&gt;], on: { entity }, fields: { METRIC_B_total_crossborder }, kind: outer&lt;/P&gt;
&lt;P&gt;| fieldsAdd&lt;BR /&gt;Rate_A = if(coalesce(METRIC_A_total, 0) == 0, 0, 100 * coalesce(METRIC_A_approved, 0) / coalesce(METRIC_A_total, 0)),&lt;BR /&gt;Rate_B = if(coalesce(METRIC_B_total, 0) == 0, 0, 100 * coalesce(METRIC_B_approved, 0) / coalesce(METRIC_B_total, 0)),&lt;BR /&gt;Rate_B_subgroup = if(coalesce(METRIC_B_total_subgroup, 0) == 0, 0, 100 * coalesce(METRIC_B_approved_subgroup, 0) / coalesce(METRIC_B_total_subgroup, 0)),&lt;BR /&gt;Rate_B_domestic = if(coalesce(METRIC_B_total_domestic, 0) == 0, 0, 100 * coalesce(METRIC_B_approved_domestic, 0) / coalesce(METRIC_B_total_domestic, 0)),&lt;BR /&gt;Rate_B_crossborder = if(coalesce(METRIC_B_total_crossborder, 0) == 0, 0, 100 * coalesce(METRIC_B_approved_crossborder, 0) / coalesce(METRIC_B_total_crossborder, 0))&lt;/P&gt;
&lt;P&gt;| filter not(isNull(entity) or entity == "")&lt;BR /&gt;| fieldsAdd&lt;BR /&gt;Entity = entity,&lt;BR /&gt;A.Total = toLong(coalesce(METRIC_A_total, 0)),&lt;BR /&gt;A.Rate = concat(toString(round(coalesce(Rate_A, 0), decimals: 2)), "%"),&lt;BR /&gt;B.Total = toLong(coalesce(METRIC_B_total, 0)),&lt;BR /&gt;B.Rate = concat(toString(round(coalesce(Rate_B, 0), decimals: 2)), "%"),&lt;BR /&gt;B.Total.Sub = toLong(coalesce(METRIC_B_total_subgroup, 0)),&lt;BR /&gt;B.Rate.Sub = concat(toString(round(coalesce(Rate_B_subgroup, 0), decimals: 2)), "%"),&lt;BR /&gt;B.Total.Dom = toLong(coalesce(METRIC_B_total_domestic, 0)),&lt;BR /&gt;B.Rate.Dom = concat(toString(round(coalesce(Rate_B_domestic, 0), decimals: 2)), "%"),&lt;BR /&gt;B.Total.XB = toLong(coalesce(METRIC_B_total_crossborder, 0)),&lt;BR /&gt;B.Rate.XB = concat(toString(round(coalesce(Rate_B_crossborder, 0), decimals: 2)), "%")&lt;/P&gt;
&lt;P&gt;| fields Entity, A.Total, A.Rate, B.Total, B.Rate, B.Total.Dom, B.Rate.Dom, B.Total.XB, B.Rate.XB, B.Total.Sub, B.Rate.Sub&lt;BR /&gt;| sort A.Rate desc&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 10:26:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Remove-Duplicate-Entries-in-Custom-Metric-Data-Using-DQL/m-p/282664#M2393</guid>
      <dc:creator>knallapa</dc:creator>
      <dc:date>2025-12-17T10:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Duplicate Entries in Custom Metric Data Using DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Remove-Duplicate-Entries-in-Custom-Metric-Data-Using-DQL/m-p/291669#M2894</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/87812"&gt;@knallapa&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;SPAN&gt;I just wanted to check in and see if you still need help with this. If so, I’d be happy to look into it for you!&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know what works best for you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 10:26:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Remove-Duplicate-Entries-in-Custom-Metric-Data-Using-DQL/m-p/291669#M2894</guid>
      <dc:creator>IzabelaRokita</dc:creator>
      <dc:date>2025-12-17T10:26:30Z</dc:date>
    </item>
  </channel>
</rss>

