<?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: Count nulls in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331427#M824426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the script if you use aggregation function(like count(), sum(), ...), you have to use &lt;STRONG&gt;Group By&lt;/STRONG&gt; clause as well. Perhaps, you are missing that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jul 2017 09:20:09 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2017-07-19T09:20:09Z</dc:date>
    <item>
      <title>Count nulls in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331426#M824425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this should be very straightforward, but after reading several forum responses, I still can't find a working solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a large dataset. If a particular field (Target) is null in &lt;STRONG&gt;all&lt;/STRONG&gt; cases, then I would like to use certain expressions in my qvw. However, if the field as some values (i.e. not &lt;STRONG&gt;all&lt;/STRONG&gt; null), then I would like to use different expressions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My solution to this was to create a new field in the script, that would flag which route to go down. I used the following expression (amongst many other attempts):&lt;/P&gt;&lt;P&gt;IF(COUNT(IF(LEN(TRIM(Target))&amp;gt;0,Target))&amp;gt;0,'Combined','All') as Report_type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using this expression in a text box on the qvw seems to work, and I get the appropriate 'Combined' or 'All' depending on which dataset I load. But in the script, I get an 'invalid expression' warning. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why isn't it working in the script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331426#M824425</guid>
      <dc:creator>jessica_webb</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count nulls in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331427#M824426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the script if you use aggregation function(like count(), sum(), ...), you have to use &lt;STRONG&gt;Group By&lt;/STRONG&gt; clause as well. Perhaps, you are missing that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 09:20:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331427#M824426</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-07-19T09:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count nulls in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331428#M824427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You said, You are using this in text box? Can you try that by help Group By during aggregation involved, May be?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 09:21:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331428#M824427</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-07-19T09:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Count nulls in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331429#M824428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because of aggregation function which your using. &lt;/P&gt;&lt;P&gt;Aggregation function required group by clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also create flag in script like&lt;/P&gt;&lt;P&gt;if(len(trim(Target))=0,'null','Not Null') as flag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then use flag in front end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 09:22:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331429#M824428</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2017-07-19T09:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Count nulls in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331430#M824429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Exactly the problem! Thank you so much &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 09:23:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331430#M824429</guid>
      <dc:creator>jessica_webb</dc:creator>
      <dc:date>2017-07-19T09:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Count nulls in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331431#M824430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jessica,&lt;/P&gt;&lt;P&gt;I know I'm coming late to this party but you could consider&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FieldValueCount(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Target&lt;/SPAN&gt;) in your script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't remember if it returns zero or is null if the Target field has no values but either way it might be an easy test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 09:40:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331431#M824430</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2017-07-19T09:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Count nulls in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331432#M824431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrew, &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks for the suggestion. When using that in a textbox it gives me a null value... Not sure what its function is? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Jess&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 09:46:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331432#M824431</guid>
      <dc:creator>jessica_webb</dc:creator>
      <dc:date>2017-07-19T09:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Count nulls in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331433#M824432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jessica,&lt;/P&gt;&lt;P&gt;FieldValueCount returns the number of unique values of a field and can be used in the UI or in script. The neat thing about it is that it doesn't do this by trawling through all the data. It gives the number of rows in a field's symbol table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To explain what that's all about there is no-one better than &lt;A href="https://community.qlik.com/people/hic"&gt;hic&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2848"&gt;Symbol Tables and Bit-Stuffed Pointers&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 09:55:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-nulls-in-script/m-p/1331433#M824432</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2017-07-19T09:55:47Z</dc:date>
    </item>
  </channel>
</rss>

