<?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 nice to know: Using a filter, but when not in filter then show record with empty attribute in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/DQL-nice-to-know-Using-a-filter-but-when-not-in-filter-then-show/m-p/266517#M1574</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Maybe this is handy for someone. Suppose you want to use a filter, but you also want to show records not within the filter with an empty attribute&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to fetch the data twice (-; The "data" example:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; data record(rec=1,data =1),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; record(rec=2,data =2) ,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; record(rec=3,data =1),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; record(rec=4,data =3)&lt;BR /&gt;| filter (data == 1)&lt;BR /&gt;| fieldsadd newdata = data&lt;BR /&gt;| append [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data record(rec=1,data =1),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;record(rec=2,data =2) ,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;record(rec=3,data =1),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;record(rec=4,data =3)]&lt;BR /&gt;| dedup rec, sort:(newdata)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Use the "null" values last!&lt;BR /&gt;| fieldsAdd data = if(isNull(newdata), "", else:data)&amp;nbsp; //&amp;nbsp; Replace ugly null by ""&lt;BR /&gt;|fieldsRemove newdata&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //&amp;nbsp; &amp;nbsp;Remove the temp column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henk_stobbe_0-1735829453188.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/25544iB9A68400471CEDE9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="henk_stobbe_0-1735829453188.png" alt="henk_stobbe_0-1735829453188.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any comments, issue's or has a better way?&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jan 2025 14:52:16 GMT</pubDate>
    <dc:creator>henk_stobbe</dc:creator>
    <dc:date>2025-01-02T14:52:16Z</dc:date>
    <item>
      <title>DQL nice to know: Using a filter, but when not in filter then show record with empty attribute</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-nice-to-know-Using-a-filter-but-when-not-in-filter-then-show/m-p/266517#M1574</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Maybe this is handy for someone. Suppose you want to use a filter, but you also want to show records not within the filter with an empty attribute&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to fetch the data twice (-; The "data" example:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; data record(rec=1,data =1),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; record(rec=2,data =2) ,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; record(rec=3,data =1),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; record(rec=4,data =3)&lt;BR /&gt;| filter (data == 1)&lt;BR /&gt;| fieldsadd newdata = data&lt;BR /&gt;| append [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data record(rec=1,data =1),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;record(rec=2,data =2) ,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;record(rec=3,data =1),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;record(rec=4,data =3)]&lt;BR /&gt;| dedup rec, sort:(newdata)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Use the "null" values last!&lt;BR /&gt;| fieldsAdd data = if(isNull(newdata), "", else:data)&amp;nbsp; //&amp;nbsp; Replace ugly null by ""&lt;BR /&gt;|fieldsRemove newdata&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //&amp;nbsp; &amp;nbsp;Remove the temp column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henk_stobbe_0-1735829453188.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/25544iB9A68400471CEDE9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="henk_stobbe_0-1735829453188.png" alt="henk_stobbe_0-1735829453188.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any comments, issue's or has a better way?&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 14:52:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-nice-to-know-Using-a-filter-but-when-not-in-filter-then-show/m-p/266517#M1574</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2025-01-02T14:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: DQL nice to know: Using a filter, but when not in filter then show record with empty attribute</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-nice-to-know-Using-a-filter-but-when-not-in-filter-then-show/m-p/266535#M1575</link>
      <description>&lt;P&gt;I might be missing something here, but why not just use the IF clause without the append?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;data 
  record(rec=1,data=1),
  record(rec=2,data=2),
  record(rec=3,data=1),
  record(rec=4,data=3)
| fieldsAdd data = if(data == 1, data, else: "")
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example of the result can be seen in the Security Investigator in Dynatrace Playground:&amp;nbsp;&lt;A href="https://wkf10640.apps.dynatrace.com/ui/apps/dynatrace.security.investigator/share/2e02f2c7-8781-4e95-bd73-d5c792fc9281" target="_blank" rel="noopener"&gt;https://wkf10640.apps.dynatrace.com/ui/apps/dynatrace.security.investigator/share/2e02f2c7-8781-4e95-bd73-d5c792fc9281&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 15:40:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-nice-to-know-Using-a-filter-but-when-not-in-filter-then-show/m-p/266535#M1575</guid>
      <dc:creator>Tiit_Hallas</dc:creator>
      <dc:date>2025-01-02T15:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: DQL nice to know: Using a filter, but when not in filter then show record with empty attribute</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-nice-to-know-Using-a-filter-but-when-not-in-filter-then-show/m-p/266540#M1576</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;You are not missing anything, from where I am sitting you are brilliant!&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 15:55:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-nice-to-know-Using-a-filter-but-when-not-in-filter-then-show/m-p/266540#M1576</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2025-01-02T15:55:37Z</dc:date>
    </item>
  </channel>
</rss>

