<?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: Sum() behaviour with null values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000890#M340227</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/107500_1.png" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Nov 2015 20:35:59 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2015-11-27T20:35:59Z</dc:date>
    <item>
      <title>Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000887#M340224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why is it that Sum() returns 0 if the value in that row is actually NULL?&lt;/P&gt;&lt;P&gt;This is (at least) a bit annoying if not wrong in some cases.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="99" style="border: 1px solid #000000; width: 238px; height: 84px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Accidents&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2014&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(Accidents)&amp;nbsp; for all three Years returns 6 which is correct.&lt;/P&gt;&lt;P&gt;If a User selects year 2016 only, QV will return 0 which is totally incorrect. Its like QV knows, that it will be 0 in all 2016?!&lt;/P&gt;&lt;P&gt;It rather should return NULL...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to treat this right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 19:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000887#M340224</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-27T19:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000888#M340225</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;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Sum(Accidents) &amp;gt; 0, Sum(Accidents))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 19:22:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000888#M340225</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-27T19:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000889#M340226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oh my, simple as that. Tried many much more complicated things....but havent thought about such a nice and easy solution. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 20:28:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000889#M340226</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-27T20:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000890#M340227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/107500_1.png" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 20:35:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000890#M340227</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-11-27T20:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000891#M340228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hahahaha ... I have over-complicated some easy things in the past, so you are not alone there. But I am glad we were able to figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 20:36:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000891#M340228</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-27T20:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000892#M340229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess it can be modified to be something like this if there can be negative sums &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If(Sum(Accidents) &lt;SPAN style="color: #ff0000;"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; 0, Sum(Accidents))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 20:47:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000892#M340229</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-27T20:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000893#M340230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thx maxgro for the hint! You have to keep that in mind if youre messing around with "if&amp;gt;0"...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 20:49:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000893#M340230</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-27T20:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000894#M340231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I must defend the honour of QlikView here! It is quite correct. The number of accidents recorded in 2016 is currently zero.&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 23:09:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000894#M340231</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2015-11-27T23:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000895#M340232</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;/P&gt;&lt;P&gt;yah, youre not wrong there per se.&lt;/P&gt;&lt;P&gt;But lets assume there are some managers in the company where i work, who are seeing this a little bit different. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Nov 2015 06:58:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000895#M340232</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-28T06:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000896#M340233</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 im facing some performance problems. As you know "if" is not very performant.&lt;/P&gt;&lt;P&gt;Is there another way to get this done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 12:10:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000896#M340233</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-17T12:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000897#M340234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try this, but not sure how much performance benefit you will get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-weight: bold;"&gt;Sum({&amp;lt;Year = {"=&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; font-weight: bold;"&gt;Sum(Accidents) &lt;/SPAN&gt;&lt;SPAN style="font-weight: bold; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; font-weight: bold;"&gt; 0&lt;/SPAN&gt;"}&amp;gt;}Accidents)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 12:15:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000897#M340234</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-12-17T12:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000898#M340235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry, it also shows "0" instead of "-"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 12:30:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000898#M340235</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-17T12:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sum() behaviour with null values</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000899#M340236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right. Not sure another way of doing this, except doing this with an if statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 12:39:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-behaviour-with-null-values/m-p/1000899#M340236</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-12-17T12:39:29Z</dc:date>
    </item>
  </channel>
</rss>

