<?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: If Not isnull  query in count in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/If-Not-isnull-query-in-count/m-p/1942605#M77659</link>
    <description>&lt;P&gt;Best to create flag fields as&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6748"&gt;@stevedark&lt;/a&gt;&amp;nbsp;suggested for both&amp;nbsp; &amp;nbsp;criteria's&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;if(WADAT_IST] &amp;gt; [WADAT], 1, 0) as flag_gt,&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;if(isnull(WADAT_IST), 0, 1) as HasWADAT,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but the below should also work&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=count ({&amp;lt; VBELN = {"=([WADAT_IST] &amp;gt; [WADAT])&amp;nbsp; &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;OR&amp;nbsp; len(WADAT_IST)=0&lt;/STRONG&gt;&lt;/FONT&gt;"}, WBSTK = {'C'}, LFART ={'XLF'} &amp;gt;} VBELN ) / COUNT ( {&amp;lt;WBSTK = {'C'} , LFART ={'XLF'}&amp;gt;} VBELN)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;with flag fields&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=count ({&amp;lt; VBELN = {"=&lt;STRONG&gt;flag_gt=1 or&amp;nbsp;&amp;nbsp;HasWADAT=1&lt;/STRONG&gt;"}, WBSTK = {'C'}, LFART ={'XLF'} &amp;gt;} VBELN ) / COUNT ( {&amp;lt;WBSTK = {'C'} , LFART ={'XLF'}&amp;gt;} VBELN)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;OR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=count ({&amp;lt; VBELN = p({&amp;lt;flag_gt={1}&amp;gt;VBELN )+p({&amp;lt;&lt;STRONG&gt;HasWADAT&lt;/STRONG&gt;={1}&amp;gt;VBELN ), WBSTK = {'C'}, LFART ={'XLF'} &amp;gt;} VBELN ) / COUNT ( {&amp;lt;WBSTK = {'C'} , LFART ={'XLF'}&amp;gt;} VBELN)&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jun 2022 05:37:01 GMT</pubDate>
    <dc:creator>vinieme12</dc:creator>
    <dc:date>2022-06-13T05:37:01Z</dc:date>
    <item>
      <title>If Not isnull  query in count</title>
      <link>https://community.qlik.com/t5/App-Development/If-Not-isnull-query-in-count/m-p/1942223#M77612</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;
&lt;P&gt;Hope your Friday is going well and you have a pleasant weekend ahead of you.&lt;/P&gt;
&lt;P&gt;I have a working expression that I would like to 'tweak' if possible. The fields are SAP field names.&lt;/P&gt;
&lt;P&gt;count ({&amp;lt; VBELN = {"=[WADAT_IST] &amp;gt; [WADAT] "}, WBSTK = {'C'}, LFART ={'XLF'} &amp;gt;} VBELN ) / COUNT ( {&amp;lt;WBSTK = {'C'} , LFART ={'XLF'}&amp;gt;} VBELN)&lt;/P&gt;
&lt;P&gt;So a count where a date (WADAT_IST) is compared against WADAT in the above its to see if it is greater than, which means its late (I have an = and a &amp;lt; than version for on time and early).&amp;nbsp; A couple of = '' to check that it is 'C' complete and belongs to a particular delivery group 'XLF'.&lt;/P&gt;
&lt;P&gt;I would like if it is possible to check to see if WADAT_IST is populated and if not (ie null) have it included in my count as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that makes sense!&lt;/P&gt;
&lt;P&gt;Example image of the date fields.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daryn_0-1654867219508.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/81495i104B7C760F3AC37B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daryn_0-1654867219508.png" alt="Daryn_0-1654867219508.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 13:21:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-Not-isnull-query-in-count/m-p/1942223#M77612</guid>
      <dc:creator>Daryn</dc:creator>
      <dc:date>2022-06-10T13:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: If Not isnull  query in count</title>
      <link>https://community.qlik.com/t5/App-Development/If-Not-isnull-query-in-count/m-p/1942466#M77638</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/135319"&gt;@Daryn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can write not null in Set Analysis using&amp;nbsp;&lt;STRONG&gt;WADAT_IST*={"*"}&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Note that the first * is allowing selections in&amp;nbsp;&lt;SPAN&gt;WADAT_IST to still be considered, the second * is a wildcard which matches any non-null value.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For more details on the first * see:&lt;BR /&gt;&lt;A href="https://www.quickintelligence.co.uk/qlik-set-analysis-star-equals/" target="_blank"&gt;https://www.quickintelligence.co.uk/qlik-set-analysis-star-equals/&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If some or all of the fields appear in a single row in the source data, you can make things much more efficient (and easier to code for) by working out flags in the load script, for example:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if(isnull(WADAT_IST), 0, 1) as HasWADAT,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Also, it is good practice to rename all fields in the load script, so they are human friendly (rather than SAP friendly) in the front end.&lt;/P&gt;
&lt;P&gt;Hope that helps,&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jun 2022 19:49:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-Not-isnull-query-in-count/m-p/1942466#M77638</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2022-06-11T19:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: If Not isnull  query in count</title>
      <link>https://community.qlik.com/t5/App-Development/If-Not-isnull-query-in-count/m-p/1942605#M77659</link>
      <description>&lt;P&gt;Best to create flag fields as&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6748"&gt;@stevedark&lt;/a&gt;&amp;nbsp;suggested for both&amp;nbsp; &amp;nbsp;criteria's&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;if(WADAT_IST] &amp;gt; [WADAT], 1, 0) as flag_gt,&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;if(isnull(WADAT_IST), 0, 1) as HasWADAT,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but the below should also work&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=count ({&amp;lt; VBELN = {"=([WADAT_IST] &amp;gt; [WADAT])&amp;nbsp; &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;OR&amp;nbsp; len(WADAT_IST)=0&lt;/STRONG&gt;&lt;/FONT&gt;"}, WBSTK = {'C'}, LFART ={'XLF'} &amp;gt;} VBELN ) / COUNT ( {&amp;lt;WBSTK = {'C'} , LFART ={'XLF'}&amp;gt;} VBELN)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;with flag fields&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=count ({&amp;lt; VBELN = {"=&lt;STRONG&gt;flag_gt=1 or&amp;nbsp;&amp;nbsp;HasWADAT=1&lt;/STRONG&gt;"}, WBSTK = {'C'}, LFART ={'XLF'} &amp;gt;} VBELN ) / COUNT ( {&amp;lt;WBSTK = {'C'} , LFART ={'XLF'}&amp;gt;} VBELN)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;OR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=count ({&amp;lt; VBELN = p({&amp;lt;flag_gt={1}&amp;gt;VBELN )+p({&amp;lt;&lt;STRONG&gt;HasWADAT&lt;/STRONG&gt;={1}&amp;gt;VBELN ), WBSTK = {'C'}, LFART ={'XLF'} &amp;gt;} VBELN ) / COUNT ( {&amp;lt;WBSTK = {'C'} , LFART ={'XLF'}&amp;gt;} VBELN)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 05:37:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-Not-isnull-query-in-count/m-p/1942605#M77659</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2022-06-13T05:37:01Z</dc:date>
    </item>
  </channel>
</rss>

