<?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 QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439896#M1163956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Melanie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually yes. The IF() function in this case is a QlikView function, not a SQL function. Your script should look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13486578261203444" jivemacro_uid="_13486578261203444"&gt;&lt;P&gt;// This part may change, and you may or may not not require the table name before the field name&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD IncidentID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DateReturnedToWork,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;InvolvedPerson,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;If(Len(DateReturnedToWork), 0, 1) AS NullCounter&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL SELECT search_Incident_Custom_Joined.IncidentID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;search_Incident_Injuries.DateReturnedToWork,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;search_Incident_Injuries.InvolvedPerson&lt;/P&gt;&lt;P&gt;FROM .......&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that makes sense now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Sep 2012 11:12:38 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2012-09-26T11:12:38Z</dc:date>
    <item>
      <title>Count Nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439891#M1163951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Afternoon, I've done a quick search but can't quite find the answer I need.&lt;/P&gt;&lt;P&gt;Basically I'm loading in data like below and beed to only show the rows where the date returned is blank, how do I write this as an expression.&lt;/P&gt;&lt;P&gt;I don't think I can do this via the load script as I need to calculate other things.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="332"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="115"&gt;Date&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none;" width="92"&gt;Person&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none;" width="125"&gt;DateReturned&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;01/01/2012&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;J. Bloggs&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;10/02/2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;02/01/2012&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;A.N Other&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;03/01/2012&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;C. Clott&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;04/01/2012&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;S. Else&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;11/02/2012&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 15:43:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439891#M1163951</guid>
      <dc:creator />
      <dc:date>2012-09-25T15:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Count Nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439892#M1163952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd do that in the load script, using the Len() function, it will perform faster and will make easier to count them in the expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13485880140129795" jivemacro_uid="_13485880140129795"&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD Person,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateReturned,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Len(DateReturned), 0, 1) AS NullCounter&lt;/P&gt;&lt;P&gt;FROM ...&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression should be now as simple as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13485880140128053" jivemacro_uid="_13485880140128053"&gt;&lt;P&gt;Sum(NullCounter)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or tu sum up the Sales field only for those who have nulls:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13485880319254281" jivemacro_uid="_13485880319254281"&gt;&lt;P&gt;Sum({&amp;lt; NullCounter = {1} &amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you still want to do it in an expression, do something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13485880726077093" jivemacro_uid="_13485880726077093"&gt;&lt;P&gt;Only({&amp;lt; DateReturned = {"=Len(DateReturned) = 0"} &amp;gt;} Person)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 15:46:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439892#M1163952</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-09-25T15:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Count Nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439893#M1163953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that doesn't seem to be laoding correctly - this is what my script looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; SELECT search_Incident_Custom_Joined.IncidentID, &lt;BR /&gt;search_Incident_Injuries.DateReturnedToWork,&lt;BR /&gt;search_Incident_Injuries.InvolvedPerson,&lt;BR /&gt;If(Len(DateReturnedToWork),0,1) AS NullCounter&lt;BR /&gt;&lt;BR /&gt;FROM ....... &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 16:06:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439893#M1163953</guid>
      <dc:creator />
      <dc:date>2012-09-25T16:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Count Nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439894#M1163954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the LOAD always before the SQL statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD Field1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; field2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL SELECT Field1, field2&lt;/P&gt;&lt;P&gt;FROM ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 16:35:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439894#M1163954</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-09-25T16:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Count Nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439895#M1163955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry that is still not working, when I reload there is the following error "Incorrect syntax near the keyword 'If'."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've added the Load statement before the SQL, everything still works except for this line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If(Len(DateReturnedToWork),0,1) AS NullCounter &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have I missed something???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 08:30:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439895#M1163955</guid>
      <dc:creator />
      <dc:date>2012-09-26T08:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Count Nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439896#M1163956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Melanie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually yes. The IF() function in this case is a QlikView function, not a SQL function. Your script should look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13486578261203444" jivemacro_uid="_13486578261203444"&gt;&lt;P&gt;// This part may change, and you may or may not not require the table name before the field name&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD IncidentID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DateReturnedToWork,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;InvolvedPerson,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;If(Len(DateReturnedToWork), 0, 1) AS NullCounter&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL SELECT search_Incident_Custom_Joined.IncidentID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;search_Incident_Injuries.DateReturnedToWork,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;search_Incident_Injuries.InvolvedPerson&lt;/P&gt;&lt;P&gt;FROM .......&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that makes sense now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 11:12:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Nulls/m-p/439896#M1163956</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-09-26T11:12:38Z</dc:date>
    </item>
  </channel>
</rss>

