<?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 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script/m-p/1690133#M450578</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:12 GMT</pubDate>
    <dc:creator>Ahmed_Turnaround</dc:creator>
    <dc:date>2020-04-02T07:37:12Z</dc:date>
    <item>
      <title>Calculation within Script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script/m-p/1680299#M450019</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did some research and couldn't find the answer, so I thought I'd make a new topic and hope that hasn't broken any rules. I am trying to put a calculated field within my Load Script but I'm having trouble doing this. My script, currently is as follows:&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;&lt;SPAN&gt;I then want to calculate a figure based on whether a sub category ID matches a specific number. I have the following code, which I've put before the DROP TABLES command, but it doesn't seem to work:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&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;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Below is what is underlined in error:&lt;/SPAN&gt;&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: 685px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/29306i56140AF5A585E54A/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;Any ideas what I am doing wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 10:32:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script/m-p/1680299#M450019</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2020-02-28T10:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation within Script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script/m-p/1690024#M450569</link>
      <description>&lt;P&gt;Only thing of which I can think may be quote related, here is a Design Blog link to check on things there:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Quotes-in-Set-Analysis/ba-p/1471824" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Quotes-in-Set-Analysis/ba-p/1471824&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you need to do some further searching, you can use the following URL to have access to the search box:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog&lt;/A&gt;&lt;/P&gt;&lt;P&gt;My post will kick things back up again too, so someone else may revisit and confirm or point out something else.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 19:28:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script/m-p/1690024#M450569</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2020-04-01T19:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation within Script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script/m-p/1690028#M450570</link>
      <description>&lt;P&gt;Set analysis is a concept used on the front end of an application. Backend can use if statement like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATIONS:
LOAD [SUB CATEGORY ID],
      -1* SUM(If([SUB CATEGORY ID] = 10, [GL MOVEMENT BASE])) as [TEST TOTAL TRADE SALES]
Resident GLBALANCEMASTER
Group By [SUB CATEGORY ID];&lt;/LI-CODE&gt;&lt;P&gt;or you can do this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATIONS:
LOAD [SUB CATEGORY ID],
      -1 * SUM([GL MOVEMENT BASE]) as [TEST TOTAL TRADE SALES]
Resident GLBALANCEMASTER
Where [SUB CATEGORY ID] = 10
Group By [SUB CATEGORY ID];&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 01 Apr 2020 19:37:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script/m-p/1690028#M450570</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-04-01T19:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation within Script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-within-Script/m-p/1690133#M450578</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:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-within-Script/m-p/1690133#M450578</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2020-04-02T07:37:12Z</dc:date>
    </item>
  </channel>
</rss>

