<?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 within Script failing in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1690134#M450579</link>
    <description>&lt;P&gt;Thanks guys, will review and get back to you all ASAP.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Apr 2020 07:37:24 GMT</pubDate>
    <dc:creator>Ahmed_Turnaround</dc:creator>
    <dc:date>2020-04-02T07:37:24Z</dc:date>
    <item>
      <title>Calculation within Script failing</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1680326#M450022</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope you're all well on this lovely Friday morning in the UK! I was wondering if anyone can assist with helping me figure out why my calculation in my script is in error?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GLBALANCEMASTER:&lt;BR /&gt;LOAD [GL BAL KEY],&lt;BR /&gt;[BALANCE FILE SUMMARY LEVEL],&lt;BR /&gt;[GL COMPANY ID],&lt;BR /&gt;[PROFIT CENTRE ID],&lt;BR /&gt;[GL ACCOUNT MAJOR ID],&lt;BR /&gt;[GL ACCOUNT MINOR ID],&lt;BR /&gt;[GL CURRENCY],&lt;BR /&gt;[YEAR END],&lt;BR /&gt;[OPENING BALANCE FOR YEAR],&lt;BR /&gt;[GL PERIOD NN],&lt;BR /&gt;[GL MOVEMENT BASE],&lt;BR /&gt;[GL PERIOD],&lt;BR /&gt;[CLOSING BALANCE BASE],&lt;BR /&gt;[GL MOVEMENT CONSOL1],&lt;BR /&gt;[GL MOVEMENT CONSOL2],&lt;BR /&gt;[CLOSING BALANCE CONSOL1],&lt;BR /&gt;[CLOSING BALANCE CONSOL2],&lt;BR /&gt;[GL ACCOUNT MINOR],&lt;BR /&gt;[GL BAL KEY] &amp;amp; '%' &amp;amp; [GL PERIOD NN] as [GL_BAL_KEY_2]&lt;BR /&gt;FROM&lt;BR /&gt;[E:\Qlikdata\IP1 Insight Pack 1.4\Data\TA.GLBalance.qvd]&lt;BR /&gt;(QVD);&lt;/P&gt;&lt;P&gt;MAPCG:&lt;BR /&gt;LOAD [GL ACCOUNT MAJOR ID],&lt;BR /&gt;[PROFIT CENTRE ID],&lt;BR /&gt;[Sub Category ID] as [SUB CATEGORY ID],&lt;BR /&gt;[Sub Category Sale or Cost ID] as [SUB CATEGORY SALE OR COST ID]&lt;BR /&gt;FROM&lt;BR /&gt;[E:\Qlikdata\IP1 Insight Pack 1.4\Data\TA.MAPCG.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;SUBCATEGORY:&lt;BR /&gt;LOAD [Sub Category ID] as [SUB CATEGORY ID],&lt;BR /&gt;[Sub Category Description] as [SUB CATEGORY DESCRIPTION],&lt;BR /&gt;[Sub Category Sale or Cost ID] as [SUB CATEGORY SALE OR COST ID]&lt;BR /&gt;FROM&lt;BR /&gt;[E:\Qlikdata\IP1 Insight Pack 1.4\Data\TA.AccountSubCategory.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;SALECOST:&lt;BR /&gt;LOAD [Sub Category Sale or Cost ID] as [SUB CATEGORY SALE OR COST ID],&lt;BR /&gt;[Sub Category Sale or Cost Description] as [SUB CATEGORY SALE OR COST DESCRIPTION]&lt;BR /&gt;FROM&lt;BR /&gt;[E:\Qlikdata\IP1 Insight Pack 1.4\Data\TA.AccountSaleCost.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;JOIN (GLBALANCEMASTER)&lt;BR /&gt;LOAD * RESIDENT MAPCG;&lt;/P&gt;&lt;P&gt;JOIN (GLBALANCEMASTER)&lt;BR /&gt;LOAD * RESIDENT SUBCATEGORY;&lt;/P&gt;&lt;P&gt;JOIN (GLBALANCEMASTER)&lt;BR /&gt;LOAD * RESIDENT SALECOST;&lt;/P&gt;&lt;P&gt;DROP TABLE MAPCG;&lt;BR /&gt;DROP TABLE SUBCATEGORY;&lt;BR /&gt;DROP TABLE SALECOST;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After this, I have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATIONS:&lt;BR /&gt;LOAD&lt;BR /&gt;[SUB CATEGORY ID],&lt;BR /&gt;SUM({&amp;lt;[SUB CATEGORY ID] = {'10'}&amp;gt;} [GL MOVEMENT BASE]) *-1) as [TEST TOTAL TRADE SALES]&lt;BR /&gt;RESIDENT (GLBALANCEMASTER)&lt;BR /&gt;GROUP BY [SUB CATEGORY ID];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the sum is being shown in error:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance is greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 11:19:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1680326#M450022</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2020-02-28T11:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation within Script failing</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1680443#M450030</link>
      <description>&lt;P&gt;I don't think you can use set analysis in script.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SUM({&amp;lt;[SUB CATEGORY ID] = {'10'}&amp;gt;} [GL MOVEMENT BASE]) *-1) as [TEST TOTAL TRADE SALES]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Maybe:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum(if([SUB CATEGORY ID] = '10',[GL MOVEMENT BASE]) *-1) as&amp;nbsp;[TEST TOTAL TRADE SALES]&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 15:27:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1680443#M450030</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2020-02-28T15:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation within Script failing</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1680798#M450058</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculation is no longer in error now but it gets an error when it runs. I'll try and figure out why, but can you see anything obvious or what this error message relates to?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 1.PNG" style="width: 643px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/29407iDAE01D2AA6AF8272/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 1.PNG" alt="Screenshot 1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help and thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 09:00:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1680798#M450058</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2020-03-02T09:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation within Script failing</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1680807#M450059</link>
      <description>&lt;P&gt;I took the brackets out of GLBALANCEMASTER and the error went but now I have this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Invalid expression&lt;BR /&gt;CALCULATIONS:&lt;BR /&gt;LOAD&lt;BR /&gt;[SUB CATEGORY ID],&lt;BR /&gt;sum(if([SUB CATEGORY ID] = '10',[GL MOVEMENT BASE]) *-1) as [TEST TOTAL TRADE SALES]&lt;BR /&gt;RESIDENT GLBALANCEMASTER&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 09:30:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1680807#M450059</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2020-03-02T09:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation within Script failing</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1680851#M450063</link>
      <description>&lt;P&gt;I think you may have removed this too:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;GROUP BY [SUB CATEGORY ID];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Add it back.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 11:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1680851#M450063</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2020-03-02T11:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation within Script failing</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1681381#M450093</link>
      <description>&lt;P&gt;Seems to have worked, how do I keep it in a new table, do you know? I.e. say I didn't want to add it to the GLBALANCEMASTER but to a new table called CALCULATIONS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I gather my code at the moment will append the data to GLBALANCEMASTER?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 15:26:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1681381#M450093</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2020-03-03T15:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation within Script failing</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1689945#M450563</link>
      <description>&lt;P&gt;Ahmed, be sure to use the Accept as Solution button on the posts that helped you get things working, and I believe the last piece you needed is related to automatic concatenation, which is covered in the following Help link along with how to avoid it, so hopefully that will get you everything you needed.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/LoadData/concatenate-tables.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/LoadData/concatenate-tables.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 16:12:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1689945#M450563</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2020-04-01T16:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation within Script failing</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1690134#M450579</link>
      <description>&lt;P&gt;Thanks guys, will review and get back to you all ASAP.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 07:37:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script-failing/m-p/1690134#M450579</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2020-04-02T07:37:24Z</dc:date>
    </item>
  </channel>
</rss>

