<?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 Load script calculations in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-script-calculations/m-p/222868#M75446</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I wanted to ask you the suggestions about the most efficient way of making calculations in script task, like, arithmetic operations on different accounts.&lt;/P&gt;&lt;P&gt;For example, I have a table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;BR /&gt; Account, Property1, Amount&lt;BR /&gt; a1, k, 2&lt;BR /&gt; a1, k, 4&lt;BR /&gt; a1, m, 4&lt;BR /&gt; a1, m, 4&lt;BR /&gt; a2, k, 18&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;What I actually need is a new account a3 = a1 - a2. This expression means a3 = a1,k - a2,k = 6 - 18.&lt;/P&gt;&lt;P&gt;The formulas I have to deal with often look like this:&lt;/P&gt;&lt;P&gt;R300 = IIF(A400 = 0 or R401 is NULL,&lt;BR /&gt; 0,&lt;BR /&gt; (Z500 * R501 + R401) / A400 + ValidatedAccountA&lt;BR /&gt; ),&lt;BR /&gt;where all the R accounts are parents of some other calculated accounts, Z500 is a purely calculated formula and A400 is a simple input account. R300 is one of the calculated accounts used in the hierarchy.&lt;/P&gt;&lt;P&gt;What is the best way of recalculating these data? Using the calculations in the chart expression is not an option since I have a couple of hundreds of account to recalculate inside a hierarchy and its hierarchical complexity hinders the use of chart expressions, so I was thinking about doing it directly in the load script.&lt;/P&gt;&lt;P&gt;Moreover, the real data table contains a dozen of millions of records, so I would also like to make the script run fast.&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Valera&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Apr 2010 22:56:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-04-22T22:56:50Z</dc:date>
    <item>
      <title>Load script calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-calculations/m-p/222868#M75446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I wanted to ask you the suggestions about the most efficient way of making calculations in script task, like, arithmetic operations on different accounts.&lt;/P&gt;&lt;P&gt;For example, I have a table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;BR /&gt; Account, Property1, Amount&lt;BR /&gt; a1, k, 2&lt;BR /&gt; a1, k, 4&lt;BR /&gt; a1, m, 4&lt;BR /&gt; a1, m, 4&lt;BR /&gt; a2, k, 18&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;What I actually need is a new account a3 = a1 - a2. This expression means a3 = a1,k - a2,k = 6 - 18.&lt;/P&gt;&lt;P&gt;The formulas I have to deal with often look like this:&lt;/P&gt;&lt;P&gt;R300 = IIF(A400 = 0 or R401 is NULL,&lt;BR /&gt; 0,&lt;BR /&gt; (Z500 * R501 + R401) / A400 + ValidatedAccountA&lt;BR /&gt; ),&lt;BR /&gt;where all the R accounts are parents of some other calculated accounts, Z500 is a purely calculated formula and A400 is a simple input account. R300 is one of the calculated accounts used in the hierarchy.&lt;/P&gt;&lt;P&gt;What is the best way of recalculating these data? Using the calculations in the chart expression is not an option since I have a couple of hundreds of account to recalculate inside a hierarchy and its hierarchical complexity hinders the use of chart expressions, so I was thinking about doing it directly in the load script.&lt;/P&gt;&lt;P&gt;Moreover, the real data table contains a dozen of millions of records, so I would also like to make the script run fast.&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Valera&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 22:56:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-calculations/m-p/222868#M75446</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-22T22:56:50Z</dc:date>
    </item>
    <item>
      <title>Load script calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-calculations/m-p/222869#M75447</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 feel do all the calculations at the script level itself if u do the at the chart level definitely it will result in OUT OF OBJECT MEMEORY EROR", and if u r using incremental load then it will not be a problem .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 06:37:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-calculations/m-p/222869#M75447</guid>
      <dc:creator>spsrk_84</dc:creator>
      <dc:date>2010-04-26T06:37:27Z</dc:date>
    </item>
    <item>
      <title>Load script calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-calculations/m-p/222870#M75448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG&gt;ajay,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;indeed, you are right. I actually had to make all the calculations on the script level. I had to create around 20 thousand lines of script code to load all the data... &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Valera&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 09:00:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-calculations/m-p/222870#M75448</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-26T09:00:18Z</dc:date>
    </item>
  </channel>
</rss>

