<?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: Calculation Variance within Script? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1659854#M448658</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Issue is resolved.&amp;nbsp; Brett's soultion worked the best!&lt;BR /&gt;Thanks for your help.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/P&gt;</description>
    <pubDate>Fri, 20 Dec 2019 15:57:29 GMT</pubDate>
    <dc:creator>hermanitor</dc:creator>
    <dc:date>2019-12-20T15:57:29Z</dc:date>
    <item>
      <title>Calculation Variance within Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1651931#M447916</link>
      <description>&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;i have the following table,:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;BalanceCode&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;ACT&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;BUD&lt;/TD&gt;&lt;TD&gt;70&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;ACT&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;BUD&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;within in the chart i can simple add 3 formulas:&lt;/P&gt;&lt;P&gt;Actual:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;BalanceCode=ACT&amp;gt;}Value)&lt;/P&gt;&lt;P&gt;Budget:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;BalanceCode=BUD&amp;gt;}Value)&lt;/P&gt;&lt;P&gt;Variance:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;BalanceCode=ACT&amp;gt;}Value) -&amp;nbsp;sum({&amp;lt;BalanceCode=BUD&amp;gt;}Value)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now i want to to the same in the script.&lt;/P&gt;&lt;P&gt;therefore i did the following:&lt;/P&gt;&lt;P&gt;Table:&lt;BR /&gt;LOAD ID,&lt;BR /&gt;BalanceCode,&lt;BR /&gt;Value&lt;BR /&gt;FROM&lt;BR /&gt;input.xlsx&lt;BR /&gt;(ooxml, embedded labels, table is Balcode);&lt;/P&gt;&lt;P&gt;Concatenate&lt;BR /&gt;LOAD&lt;BR /&gt;ID,&lt;BR /&gt;'dif' as BalanceCode,&lt;BR /&gt;if(BalanceCode='ACT', Value, Value*-1) as Value&lt;BR /&gt;Resident Table;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now i have one formula: sum(value) and of course i have to put in the balance code as dimension.&lt;/P&gt;&lt;P&gt;works like charm.&lt;/P&gt;&lt;P&gt;but, in the real world i started with 19milion rows, and after that i have 38milion rows... and the performance goes down.&lt;/P&gt;&lt;P&gt;any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 14:35:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1651931#M447916</guid>
      <dc:creator>sebastianfaust</dc:creator>
      <dc:date>2019-11-27T14:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Variance within Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1652090#M447929</link>
      <description>&lt;P&gt;Try noconcatenate and drop the original Fact Table:&lt;/P&gt;&lt;P&gt;Table:&lt;BR /&gt;LOAD ID,&lt;BR /&gt;BalanceCode,&lt;BR /&gt;Value&lt;BR /&gt;FROM&lt;BR /&gt;input.xlsx&lt;BR /&gt;(ooxml, embedded labels, table is Balcode);&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;ID,&lt;BR /&gt;'dif' as BalanceCode,&lt;BR /&gt;if(BalanceCode='ACT', Value, Value*-1) as Value&lt;BR /&gt;Resident Table;&lt;/P&gt;&lt;P&gt;drop table Table;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 06:32:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1652090#M447929</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-11-28T06:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Variance within Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1652224#M447935</link>
      <description>&lt;P&gt;Just create inline for the dimension instead of loading the whole data to create it&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;ID, BalanceCode, Value&lt;BR /&gt;A, ACT, 100&lt;BR /&gt;A, BUD, 70&lt;BR /&gt;C, ACT, 50&lt;BR /&gt;C, BUD, 40&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;BalanceCode, BalanceCode_F,&lt;BR /&gt;ACT,ACT&lt;BR /&gt;BUD,BUD&lt;BR /&gt;ACT,VAR&lt;BR /&gt;BUD,VAR&lt;BR /&gt;&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the chart level try the below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dimension :&amp;nbsp;&amp;nbsp;BalanceCode_F&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expression:&amp;nbsp; SUM({&amp;lt;BalanceCode_F=-{'VAR'}&amp;gt;}Value) + ( SUM({&amp;lt;BalanceCode={'ACT'},BalanceCode_F={'VAR'}&amp;gt;}Value) - SUM({&amp;lt;BalanceCode={'BUD'},BalanceCode_F={'VAR'}&amp;gt;}Value) )&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 10:55:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1652224#M447935</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2019-11-28T10:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Variance within Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1656067#M448274</link>
      <description>&lt;P&gt;Did either of the responses help you get a working solution?&amp;nbsp; If so, do not forget to return to the thread and use the Accept as Solution button on the post(s) that helped you get things sorted, as this will give the poster(s) credit for the assistance and lets other Community Members know what worked in this use case.&amp;nbsp; If you are still working on things, leave an update post.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 14:41:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1656067#M448274</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-12-10T14:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Variance within Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1658357#M448507</link>
      <description>&lt;P&gt;Hi Brett,&lt;/P&gt;&lt;P&gt;Good morning to you.&amp;nbsp; Sorry didn't realise that Sebastian had posted this query on the forum and he showed me yesterday. &amp;nbsp;&lt;BR /&gt;Have tried to make what you have advised work, but getting issues with the data on loading.&amp;nbsp; It is summing to zero over the contents of the data...which I know is wrong.&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 08:33:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1658357#M448507</guid>
      <dc:creator>hermanitor</dc:creator>
      <dc:date>2019-12-17T08:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Variance within Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1658583#M448523</link>
      <description>&lt;P&gt;I do not believe I marked the post as the solution, but I have unmarked it, please leave an update with what you guys still need in order to move forward.&amp;nbsp; You may need to attach sample app at this point for someone to be able to help figure things out.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 16:02:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1658583#M448523</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-12-17T16:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Variance within Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1658603#M448530</link>
      <description>&lt;P&gt;You can use valelist if you don't want to increase your data&lt;/P&gt;&lt;P&gt;Dimension:&lt;/P&gt;&lt;P&gt;Valuelist('Actual','Budget','Variance')&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;pick(match(Valuelist('Actual','Budget','Variance'),'Actual','Budget','Variance'),&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum({&amp;lt;BalanceCode={'ACT'}&amp;gt;}Value),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum({&amp;lt;BalanceCode={'BUD'}&amp;gt;}Value),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum({&amp;lt;BalanceCode={'ACT'}&amp;gt;}Value)-sum({&amp;lt;BalanceCode={'BUD'}&amp;gt;}Value))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 16:35:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1658603#M448530</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2019-12-17T16:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Variance within Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1659854#M448658</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Issue is resolved.&amp;nbsp; Brett's soultion worked the best!&lt;BR /&gt;Thanks for your help.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 15:57:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1659854#M448658</guid>
      <dc:creator>hermanitor</dc:creator>
      <dc:date>2019-12-20T15:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Variance within Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1660152#M448684</link>
      <description>&lt;P&gt;Hey Steve, any chance you can let me know which solution worked, as I did not really give you guys anything! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; It had to be Arthur or Qliksus, if you can let me know which one it was, I can mark that one as the solution, and we will have this closed out, unfortunately I did not make a note of which was selected before I unmarked it.... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp; Thanks in advance and sorry for the confusion, I just want to be sure we get the right post marked that helped you guys.&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 14:09:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Variance-within-Script/m-p/1660152#M448684</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-12-23T14:09:52Z</dc:date>
    </item>
  </channel>
</rss>

