<?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: Data Explorer - Transform negative value to 0 in Dashboarding</title>
    <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248347#M4048</link>
    <description>&lt;P&gt;Certainly!&lt;BR /&gt;&lt;BR /&gt;You need to be creative&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt; and use arithmetic expressions. For example if you multiply by non-existent value, you get non-existent value. If we multiply by 1 we get the same value:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(log.couchdbosprocesserror:splitBy():sum:fold(sum)/
log.couchdbosprocesserror:splitBy():sum:fold(sum))
*
(10 - log.couchdbosprocesserror
:splitBy():sum
:fold(sum))
:filter(series(sum,gt(0))):default(0,always)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I think you can see the logic here. Apply filtering and metric name accordingly to your case.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jun 2024 14:51:46 GMT</pubDate>
    <dc:creator>Julius_Loman</dc:creator>
    <dc:date>2024-06-14T14:51:46Z</dc:date>
    <item>
      <title>Data Explorer - Transform negative value to 0</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248141#M4039</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Do you know if that is possible? For example for "1 - builtin:host.cpu.usage":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AntonPineiro_0-1718196614156.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/20501i9BE710B6BAB7AFFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AntonPineiro_0-1718196614156.png" alt="AntonPineiro_0-1718196614156.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can we transform any negative value to "0"? It means, force minimal value is 0.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 12:51:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248141#M4039</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2024-06-12T12:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer - Transform negative value to 0</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248146#M4040</link>
      <description>&lt;P&gt;Sure we can!&lt;BR /&gt;&lt;BR /&gt;Apply a combination of filter and default transformations, something like below. But you must apply fold before (as you require single value)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;:fold(avg):filter(series(avg,gt(0))):default(0,always)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 13:44:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248146#M4040</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2024-06-12T13:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer - Transform negative value to 0</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248186#M4041</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for you answer but it is still negative:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AntonPineiro_0-1718211524223.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/20515i25E1964ABAF20FA8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AntonPineiro_0-1718211524223.png" alt="AntonPineiro_0-1718211524223.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Maybe I am missing something.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 16:58:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248186#M4041</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2024-06-12T16:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer - Transform negative value to 0</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248187#M4042</link>
      <description>&lt;P&gt;You have the wrong parenthesis as you apply it on the metric not on the expression. You need something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(1 - builtin:host.cpu.usage:splitBy():auto):fold(avg):filter(series(avg,gt(0))):default(0,always)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 06:36:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248187#M4042</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2024-06-13T06:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer - Transform negative value to 0</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248232#M4043</link>
      <description>&lt;P&gt;Hi Julius,&lt;/P&gt;&lt;P&gt;Ok, thank you. Then, let me explain with more details target use case.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;5
-
log.XXXXX
:filter(and(or(eq("YYYYY","ZZZZZ")),or(eq("YYYYY","ZZZZZ"))))
:splitBy()
:sum
:sort(value(sum,descending))&lt;/LI-CODE&gt;&lt;P&gt;I have an integer log metric already filtered under some dimensions. That metric is "1" or "0" and sum value in timeframe. Expresion is "target number - log metric". Normaly that expresion is "0", it means, nothing is pending.&lt;/P&gt;&lt;P&gt;But it is negative in some scenarios, and we want to transform it to "0" in those situations.&lt;/P&gt;&lt;P&gt;Are you going to follow same approach in that scenario?&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 06:51:39 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248232#M4043</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2024-06-13T06:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer - Transform negative value to 0</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248234#M4044</link>
      <description>&lt;P&gt;Sure it will. Something like this with the CPU metric, similarly for your log case&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(1 - builtin:host.cpu.usage:filter(eq("dt.entity.host","HOST-AC0325FE2CC8184B")):splitBy():auto):fold(avg):filter(series(avg,gt(0))):default(0,always)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 06:57:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248234#M4044</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2024-06-13T06:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer - Transform negative value to 0</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248263#M4045</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am not getting same, maybe for some transformation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;5
-
log.XXXXX
:filter(and(or(eq("YYYYY","ZZZZZ")),or(eq("YYYYY","ZZZZZ"))))
:splitBy()
:sum
:sort(value(sum,descending))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get "-1" and adding adding those:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(5
-
log.XXXXX
:filter(and(or(eq("YYYYY","ZZZZZ")),or(eq("YYYYY","ZZZZZ"))))
:splitBy()
:sum
)
:fold(avg):filter(series(avg,gt(0))):default(0,always)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting "1" instead of "0".&lt;/P&gt;&lt;P&gt;I have just added "()" to expresion and line ":fold(avg):filter(series(avg,gt(0))):default(0,always)".&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 13:19:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248263#M4045</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2024-06-13T13:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer - Transform negative value to 0</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248291#M4046</link>
      <description>&lt;P&gt;If you need a single value only, I'd go with:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(5
-
log.XXXXX
:filter(and(or(eq("YYYYY","ZZZZZ")),or(eq("YYYYY","ZZZZZ"))))
:splitBy()
:fold(sum))
:filter(series(avg,gt(0))):default(0,always)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;It's sometimes tricky with the folding.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 21:44:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248291#M4046</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2024-06-13T21:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer - Transform negative value to 0</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248332#M4047</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you so much!! Before I marked your answers as solutions, do you know if more logic can be applied? Some as if-else conditions. It is because if log metric does not have value (short timeframe for example), it shows "0" instead of "No data".&lt;BR /&gt;Ideal scenario would be.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If no data, shows No data or static number as "100".&lt;/LI&gt;&lt;LI&gt;If aritmetic operation is positive, shows result.&lt;/LI&gt;&lt;LI&gt;If aritmetic operation is negative, shows "0".&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;It means, any way to show only "0" with negative numbers, but not when no data points?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 12:31:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248332#M4047</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2024-06-14T12:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer - Transform negative value to 0</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248347#M4048</link>
      <description>&lt;P&gt;Certainly!&lt;BR /&gt;&lt;BR /&gt;You need to be creative&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt; and use arithmetic expressions. For example if you multiply by non-existent value, you get non-existent value. If we multiply by 1 we get the same value:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(log.couchdbosprocesserror:splitBy():sum:fold(sum)/
log.couchdbosprocesserror:splitBy():sum:fold(sum))
*
(10 - log.couchdbosprocesserror
:splitBy():sum
:fold(sum))
:filter(series(sum,gt(0))):default(0,always)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I think you can see the logic here. Apply filtering and metric name accordingly to your case.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 14:51:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248347#M4048</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2024-06-14T14:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Data Explorer - Transform negative value to 0</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248413#M4050</link>
      <description>&lt;P&gt;Catched it!&lt;/P&gt;&lt;P&gt;Thank you so much!&amp;nbsp;&lt;img class="lia-deferred-image lia-image-emoji" src="https://community.dynatrace.com/html/@9BD876A77FEF3D5EF4BC972CF8A97CB1/images/emoticons/take_my_money.png" alt=":take_my_money:" title=":take_my_money:" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 07:19:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Data-Explorer-Transform-negative-value-to-0/m-p/248413#M4050</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2024-06-17T07:19:18Z</dc:date>
    </item>
  </channel>
</rss>

