<?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 Total including forced nulls in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210972#M65378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked a treat!&lt;BR /&gt;&lt;BR /&gt;Much appricated as I wasted about half a day! Glad to see it was so simple lol&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Jul 2010 14:46:07 GMT</pubDate>
    <dc:creator>paulm</dc:creator>
    <dc:date>2010-07-01T14:46:07Z</dc:date>
    <item>
      <title>Total including forced nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210967#M65373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am quite new to QlikView but think this might be a bug, or it might just be me being stupid.&lt;/P&gt;&lt;P&gt;Anyway I have a pivot table which displays data for every row in a certain column. I only want to show a certain months so if it is not within those months I have replaced the value with a '-'. This is working fine. The issue is that the total (at the top of the column) includes these values that I have replaced with a null value when I select more than one of the conditioning selectors. When I select only one of the selectors the total does not show a value.&lt;/P&gt;&lt;P&gt;&lt;IMG src="file:/C:/DOCUME~1/eapxm/LOCALS~1/Temp/moz-screenshot-2.png" /&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-1866_sourceID:1866" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-1867_sourceID:1867" /&gt;&lt;/P&gt;&lt;P&gt;Any ideas if this is a bug, or if there is an easy way around?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 12:37:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210967#M65373</guid>
      <dc:creator>paulm</dc:creator>
      <dc:date>2010-07-01T12:37:17Z</dc:date>
    </item>
    <item>
      <title>Total including forced nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210968#M65374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's hard to be sure without seeing the actual formula you used, but I'm guessing you used something along the lines of&lt;/P&gt;&lt;P&gt;If(something=true,sum(Value),null())&lt;/P&gt;&lt;P&gt;When QV evaluates this at the summary level, your condition probably evaluates to true, and thus the values are all summed. If that's the case, try replacing it with something along the lines of:&lt;/P&gt;&lt;P&gt;sum(if(something=true,value))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need more assistance with this, please repost and try to include either a sample QVW or sample values and expected results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 13:11:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210968#M65374</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2010-07-01T13:11:53Z</dc:date>
    </item>
    <item>
      <title>Total including forced nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210969#M65375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;Did you try by using the set analysis calculation ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 13:11:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210969#M65375</guid>
      <dc:creator />
      <dc:date>2010-07-01T13:11:54Z</dc:date>
    </item>
    <item>
      <title>Total including forced nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210970#M65376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code I am using is within the expression tab:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;= if(RegisterType='Wattless Units' and sum ({&amp;lt;CancelledBsegFlg={0}&amp;gt;} CI_BSEG_SQ.BILL_SQ)&amp;lt;0,&lt;BR /&gt;null(),&lt;BR /&gt; if(RegisterType='Load Factor' or RegisterType='Odd or Even Month',&lt;BR /&gt; null(),&lt;BR /&gt; if(RegisterType='Winter Max Demand' and ConsumptionMonth='Mar',&lt;BR /&gt; '-',&lt;BR /&gt; if(RegisterType='Winter Max Demand' and ConsumptionMonth='Apr',&lt;BR /&gt; '-',&lt;BR /&gt; if(RegisterType='Winter Max Demand' and ConsumptionMonth='May',&lt;BR /&gt; '-',&lt;BR /&gt; if(RegisterType='Winter Max Demand' and ConsumptionMonth='Jun',&lt;BR /&gt; '-',&lt;BR /&gt; if(RegisterType='Winter Max Demand' and ConsumptionMonth='Jul',&lt;BR /&gt; '-',&lt;BR /&gt; if(RegisterType='Winter Max Demand' and ConsumptionMonth='Aug',&lt;BR /&gt; '-',&lt;BR /&gt; if(RegisterType='Winter Max Demand' and ConsumptionMonth='Sep',&lt;BR /&gt; '-',&lt;BR /&gt; if(RegisterType='Winter Max Demand' and ConsumptionMonth='Oct',&lt;BR /&gt; '-',&lt;BR /&gt; sum ({&amp;lt;CancelledBsegFlg={0}&amp;gt;} CI_BSEG_SQ.BILL_SQ),&lt;BR /&gt;&lt;BR /&gt;))))))))))&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;If I was to use set analysis would I have to write a vlue into the loader?&lt;/P&gt;&lt;P&gt;I added the sum expression and got an error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;= if(RegisterType='Wattless Units' and sum ({&amp;lt;CancelledBsegFlg={0}&amp;gt;} CI_BSEG_SQ.BILL_SQ)&amp;lt;0,&lt;BR /&gt;null(),&lt;BR /&gt; if(RegisterType='Load Factor' or RegisterType='Odd or Even Month',&lt;BR /&gt; null(),&lt;BR /&gt; sum(if(RegisterType='Winter Max Demand' and ConsumptionMonth='Mar',&lt;BR /&gt; '-',&lt;BR /&gt; sum(if(RegisterType='Winter Max Demand' and ConsumptionMonth='Apr',&lt;BR /&gt; '-'),&lt;BR /&gt; sum(if(RegisterType='Winter Max Demand' and ConsumptionMonth='May',&lt;BR /&gt; '-'),&lt;BR /&gt; sum(if(RegisterType='Winter Max Demand' and ConsumptionMonth='Jun',&lt;BR /&gt; '-'),&lt;BR /&gt; sum(if(RegisterType='Winter Max Demand' and ConsumptionMonth='Jul',&lt;BR /&gt; '-'),&lt;BR /&gt; sum(if(RegisterType='Winter Max Demand' and ConsumptionMonth='Aug',&lt;BR /&gt; '-'),&lt;BR /&gt; sum(if(RegisterType='Winter Max Demand' and ConsumptionMonth='Sep',&lt;BR /&gt; '-'),&lt;BR /&gt; sum(if(RegisterType='Winter Max Demand' and ConsumptionMonth='Oct',&lt;BR /&gt; '-'),&lt;BR /&gt; sum ({&amp;lt;CancelledBsegFlg={0}&amp;gt;} CI_BSEG_SQ.BILL_SQ),&lt;BR /&gt;&lt;BR /&gt;))))))))))&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Paul&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 13:48:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210970#M65376</guid>
      <dc:creator>paulm</dc:creator>
      <dc:date>2010-07-01T13:48:53Z</dc:date>
    </item>
    <item>
      <title>Total including forced nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210971#M65377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, that's certainly a long expression. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When your expression is evaluated at the summary level, it's probably evaluating all your conditions to 'false' - at the summary level, no single condition is true. Therefor, it uses the last Else, which is your sum. This is standard (and correct) behavior. You will need to re-write the formula so that the aggregation is outside the if() blocks rather than inside it, e.g.&lt;/P&gt;&lt;P&gt;sum(&lt;/P&gt;&lt;PRE style="margin:0px;"&gt;{&amp;lt;CancelledBsegFlg={0}&amp;gt;}&lt;/PRE&gt;&lt;P&gt;if(Condition1=true,CI_BSEG_SQ.BILL_SQ,if(Condition2=true,CI_BSEG_SQ.BILL_SQ))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;Alternatively,&lt;/P&gt;&lt;P&gt;sum(&lt;/P&gt;&lt;PRE style="margin:0px;"&gt;{&amp;lt;CancelledBsegFlg={0}&amp;gt;}&lt;/PRE&gt;&lt;P&gt;if(Condition1=true,null(),if(Condition2=true,null(),CI_BSEG_SQ.BILL_SQ))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;This being the same thing but evaluating for "Remove value if condition applies" rather than "Add value if condition applies".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure how your formula will work out with this syntax, since it contains summaries inside the actual conditions, and I think QV does not allow aggregations within aggregations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing to keep in mind when using conditional sums is that If your IF..THEN..ELSE block is outside the aggregation, it will be evaluated *once* for each dimension or summary, and then run the summary for the entire data if it evaluates to true. If you want to some partial data, you must place the condition inside the aggregation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 14:05:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210971#M65377</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2010-07-01T14:05:00Z</dc:date>
    </item>
    <item>
      <title>Total including forced nulls</title>
      <link>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210972#M65378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked a treat!&lt;BR /&gt;&lt;BR /&gt;Much appricated as I wasted about half a day! Glad to see it was so simple lol&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 14:46:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-including-forced-nulls/m-p/210972#M65378</guid>
      <dc:creator>paulm</dc:creator>
      <dc:date>2010-07-01T14:46:07Z</dc:date>
    </item>
  </channel>
</rss>

