<?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 Problem with Null Values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417948#M488191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a scenario, my expression is: count(A)+count(B).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If count(A) is null, the expression returns null even if count(B) has a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By right, I want the expression to return the value of count(B) whenever count(A) is null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody suggest a solution to this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jan 2013 04:44:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-01-14T04:44:13Z</dc:date>
    <item>
      <title>Problem with Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417948#M488191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a scenario, my expression is: count(A)+count(B).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If count(A) is null, the expression returns null even if count(B) has a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By right, I want the expression to return the value of count(B) whenever count(A) is null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody suggest a solution to this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 04:44:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417948#M488191</guid>
      <dc:creator />
      <dc:date>2013-01-14T04:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417949#M488192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;count(A+B)&lt;/P&gt;&lt;P&gt;hope it helps&lt;/P&gt;&lt;P&gt;see the attached file..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 06:23:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417949#M488192</guid>
      <dc:creator>er_mohit</dc:creator>
      <dc:date>2013-01-14T06:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417950#M488193</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;Try this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If &lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[count(A)]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Null&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[count(B)]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[count(A)]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Null&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[count(B)]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[count(A)]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; +&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[count(B)]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Nirav Bhimani&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 06:38:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417950#M488193</guid>
      <dc:creator>nirav_bhimani</dc:creator>
      <dc:date>2013-01-14T06:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417951#M488194</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;no such issue with mee..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;well try this expression as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(isnull(count(A)&amp;lt;&amp;gt;0,(Count(a) + count(B)),Count(B))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it goes well..&lt;/P&gt;&lt;P&gt;111111 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 06:44:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417951#M488194</guid>
      <dc:creator>sujeetsingh</dc:creator>
      <dc:date>2013-01-14T06:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417952#M488195</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;To avoid calculating the counts more than once, you have two options&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Use the Alt() function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;=Alt(Count(A), 0) + Alt(Count(B), 0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.Use the Rangesum function&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =RangeSum(Count(A), Count(B))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 07:16:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417952#M488195</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-01-14T07:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417953#M488196</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;QlikView have a lot of functions for developer. NumSum( expr1 [ , expr2, ... exprN ]) ==&amp;gt; Returns the numeric sum of 1 to N arguments. As opposed to the + operator, numsum will treat all non-numeric values as 0.&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;NumSum(1,2,4) returns 7&lt;/P&gt;&lt;P&gt;NumSum(1,'xyz') returns 1&lt;/P&gt;&lt;P&gt;NumSum(Null()) returns 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So within your case, you can try: NumSum(Count(A),Count(B))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help and let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 07:20:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417953#M488196</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2013-01-14T07:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417954#M488197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rereading your post, you say you want to return the value of Count(B) if Count(A) is null (ie not Count(A) + Count(B)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, again to avoid calculating Count(A) twice, you can use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =Alt(Count(A), Count(B), 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will return Count(A) if not null, otherwise Count(B), or zero if both are null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 07:23:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417954#M488197</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-01-14T07:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417955#M488198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Huge thanks bro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 08:22:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417955#M488198</guid>
      <dc:creator />
      <dc:date>2013-01-14T08:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Null Values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417956#M488199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Sokkorn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your suggestion is greatly appreciated, but actually the formula I have in hand is much more complicated than count(A)+count(B), that is a simplified scenario that I thought of.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So under my real case, NumSum() is not really applicable since the expression involves weighted average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you and I will try NumSum() in some future cases definitely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 08:29:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Null-Values/m-p/417956#M488199</guid>
      <dc:creator />
      <dc:date>2013-01-14T08:29:06Z</dc:date>
    </item>
  </channel>
</rss>

