<?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 Expressions Differences in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176811#M44661</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although it sounds like sum(A)-sum(B) will work fine for you, if you really want to do the subtraction on a row-by-row basis, here's one way to do that:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(rangesum(A,-B))&lt;/P&gt;&lt;P&gt;The rangesum() function is just like addition except that it treats nulls as 0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Nov 2010 23:54:19 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2010-11-08T23:54:19Z</dc:date>
    <item>
      <title>Expressions Differences</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176806#M44656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would have thought that the following expression:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Sum ( A - B )&lt;/P&gt;&lt;P&gt;would have produced the same results as:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Sum (A) - Sum (B).&lt;/P&gt;&lt;P&gt;But they don't, When A = 600 and B = 0, the first expression produces nothinng while the second expression produces 600. Why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Nov 2010 23:04:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176806#M44656</guid>
      <dc:creator />
      <dc:date>2010-11-08T23:04:49Z</dc:date>
    </item>
    <item>
      <title>Expressions Differences</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176807#M44657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is B NULL instead of just 0? Anything minus a null is null. But it looks like sum(B) returns 0 for nulls. So in that case, you'd see 0 for the first expression and 600 for the second expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Nov 2010 23:18:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176807#M44657</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-11-08T23:18:31Z</dc:date>
    </item>
    <item>
      <title>Expressions Differences</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176808#M44658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sum (A-B) means QlikView subtracts the values in column B from column A that are found in the same row. This is obvious when you have rows where A or B are null.&lt;/P&gt;&lt;P&gt;Sum(A) - Sum(B) sums all column A values in all the rows first and then subtracts the sum of all column B values in all the rows.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;A B&lt;BR /&gt;1 -&lt;BR /&gt;2 2&lt;/P&gt;&lt;P&gt;sum(A-B)= 0&lt;BR /&gt;sum(A)-sum(B) = 1&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Nov 2010 23:23:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176808#M44658</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-11-08T23:23:05Z</dc:date>
    </item>
    <item>
      <title>Expressions Differences</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176809#M44659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did an example by myself, and I found the same problem. Could you upload your example?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Nov 2010 23:24:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176809#M44659</guid>
      <dc:creator />
      <dc:date>2010-11-08T23:24:11Z</dc:date>
    </item>
    <item>
      <title>Expressions Differences</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176810#M44660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John.&lt;/P&gt;&lt;P&gt;You are correct the value of the B field is null in the data. I am use to treating null values equivalent to 0 in calculations and never paid that much attention to the data values because of this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Nov 2010 23:47:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176810#M44660</guid>
      <dc:creator />
      <dc:date>2010-11-08T23:47:22Z</dc:date>
    </item>
    <item>
      <title>Expressions Differences</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176811#M44661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although it sounds like sum(A)-sum(B) will work fine for you, if you really want to do the subtraction on a row-by-row basis, here's one way to do that:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(rangesum(A,-B))&lt;/P&gt;&lt;P&gt;The rangesum() function is just like addition except that it treats nulls as 0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Nov 2010 23:54:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-Differences/m-p/176811#M44661</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-11-08T23:54:19Z</dc:date>
    </item>
  </channel>
</rss>

