<?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: Problem with column totalling when using If in expressions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422869#M489362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Total mode is not changeable for me on the expressions.&amp;nbsp; It's greyed out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 10 Nov 2012 15:41:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-11-10T15:41:03Z</dc:date>
    <item>
      <title>Problem with column totalling when using If in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422865#M489358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need some help on a bit of modelling I'm trying to do.&amp;nbsp; Basically I want to forecast 2nd, 3rd and 4th quarters based on the results of 1st quarter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two variables which are used for the forecast, medicalGrowthFactor and surgicalGrowthFactor.&amp;nbsp; These need to be applied based on the text in the "Medical/Surgical" field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Q1 Actual column is a Sum().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code to calculate each of the forecast columns is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13525574774883876" jivemacro_uid="_13525574774883876"&gt;&lt;P&gt;If([Medical/Surgical] = 'Medical', //If it's medical&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ([Q1 Actual]+([Q1 Actual]*(medicalGrowthFactor/100))) //Apply medical growth factor&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([Medical/Surgical] = 'Surgical', // Else, is it surgical?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ([Q1 Actual] +([Q1 Actual]*(surgicalGrowthFactor/100))) //Apply surgical growth factor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , [Q1 Actual])) //Otherwise return Q1 Actual&lt;/P&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This works just fine and all the values I get are exactly what I'm looking for, BUT the problem I'm having is for the column totals, using 'Show Partial Sums' in pivot.&amp;nbsp; The totals all match the Q1 Actual i.e. it's not totalling the values in the column!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the code to below&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_13525575931476073" jivemacro_uid="_13525575931476073"&gt;&lt;P&gt;If([Medical/Surgical] = 'Medical', //If it's medical&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ([Q1 Actual]+([Q1 Actual]*(medicalGrowthFactor/100))) //Apply medical growth factor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , ([Q1 Actual] +([Q1 Actual]*(surgicalGrowthFactor/100))) //Apply surgical growth factor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;) &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The column total shows factors in the surgical growth but not the medical.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions??&amp;nbsp; My brain is melting.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Nov 2012 14:27:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422865#M489358</guid>
      <dc:creator />
      <dc:date>2012-11-10T14:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with column totalling when using If in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422866#M489359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you already change the Total Mode from expression to Sum of Rows? Expression Total doesn't work if you use expression names (or column references) in your expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Nov 2012 14:54:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422866#M489359</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-10T14:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with column totalling when using If in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422867#M489360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can't do that as the first column is also an expression.&amp;nbsp; Thanks for the thought though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Nov 2012 14:57:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422867#M489360</guid>
      <dc:creator />
      <dc:date>2012-11-10T14:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with column totalling when using If in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422868#M489361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;while calculating expression using if some time show you not corect result .because you applied suprees null on dimesion. if you remove the supress null check in dimension then it should match.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Nov 2012 15:17:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422868#M489361</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2012-11-10T15:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with column totalling when using If in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422869#M489362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Total mode is not changeable for me on the expressions.&amp;nbsp; It's greyed out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Nov 2012 15:41:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422869#M489362</guid>
      <dc:creator />
      <dc:date>2012-11-10T15:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with column totalling when using If in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422870#M489363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, that's sounds like you're using a pivot table. Any reason it must be a pivot table or is a straight table a possibility?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Nov 2012 15:43:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422870#M489363</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-10T15:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with column totalling when using If in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422871#M489364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no issue &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can convert first pivot into staight and check total in expression tab&lt;/P&gt;&lt;P&gt;and again convert into Pivot table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Nov 2012 15:50:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422871#M489364</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2012-11-10T15:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with column totalling when using If in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422872#M489365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great, converted to straight table and changed total method.&amp;nbsp; All good now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Mate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Nov 2012 15:54:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-column-totalling-when-using-If-in-expressions/m-p/422872#M489365</guid>
      <dc:creator />
      <dc:date>2012-11-10T15:54:31Z</dc:date>
    </item>
  </channel>
</rss>

