<?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 in script based on a field but hold calculation against a new ID in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618161#M445569</link>
    <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for your reply. Attached is an example. I can't send the whole application as there is sensitive data but this holds the data table in my previous reply and the inline table I have created for the 01/02/03.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2019 10:58:23 GMT</pubDate>
    <dc:creator>Ahmed_Turnaround</dc:creator>
    <dc:date>2019-08-29T10:58:23Z</dc:date>
    <item>
      <title>Calculation in script based on a field but hold calculation against a new ID</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618133#M445566</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wondering if someone can help me with this issue that I have. I have the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NOCONCATENATE GLBALANCE_R:
LOAD [GL BAL KEY], 
     [BALANCE FILE SUMMARY LEVEL], 
     [GL COMPANY ID], 
     [PROFIT CENTRE ID], 
     [GL ACCOUNT MAJOR ID], 
     [PROFIT CENTRE ID] + [GL ACCOUNT MAJOR ID] as PFAM_L,
     [GL ACCOUNT MINOR ID], 
     [GL CURRENCY], 
     [YEAR END], 
     [OPENING BALANCE FOR YEAR], 
     [GL PERIOD NN], 
     [GL MOVEMENT BASE], 
     [GL PERIOD], 
     [CLOSING BALANCE BASE], 
     [GL MOVEMENT CONSOL1], 
     [GL MOVEMENT CONSOL2], 
     [CLOSING BALANCE CONSOL1], 
     [CLOSING BALANCE CONSOL2], 
     [GL ACCOUNT MINOR],
     [GL BAL KEY] &amp;amp; '%' &amp;amp; [GL PERIOD NN] as [GL_BAL_KEY_2]
Resident GLBalance;

DROP TABLE GLBalance;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What needs to happen is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IF [GL COMPANY ID] = 01, 
Hold the variable [Opening Balance For Year] somewhere. 
IF [GL COMPANY ID] is 02,
Hold the variable [Opening Balance For Year] elsewhere.
Add these up together in a new field called [Opening Balance For Year Combined]

I also need to hold this data gainst a new [GL COMPANY ID] for example CO for Combined.

Repeat the same process above for [GL MOVEMENT BASE] and [CLOSING BALANCE BASE] and hold the new figures against the new [GL COMPANY ID] so that I can bring the data into a Pivot Chart.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The confusing part is that the resident table holds the values for both [GL COMPANY ID] 01 and 02. I want to keep all calculations within the script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help. I can attach the QVW application somehow if required.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:36:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618133#M445566</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2024-11-16T02:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation in script based on a field but hold calculation against a new ID</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618149#M445567</link>
      <description>&lt;P&gt;I think it might be easy to resolve this if you are able to share a qvw file.&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Sunny&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 10:47:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618149#M445567</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-08-29T10:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation in script based on a field but hold calculation against a new ID</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618161#M445569</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for your reply. Attached is an example. I can't send the whole application as there is sensitive data but this holds the data table in my previous reply and the inline table I have created for the 01/02/03.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 10:58:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618161#M445569</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2019-08-29T10:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation in script based on a field but hold calculation against a new ID</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618164#M445570</link>
      <description>&lt;P&gt;This is sample is good, but can you explain what is not as per your expectation? Is this something on the front end which doesn't look right?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/18094i7FD9ECE9F71CF837/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 11:02:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618164#M445570</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-08-29T11:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation in script based on a field but hold calculation against a new ID</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618170#M445572</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, as you can see, the company ID's 01 and 02 have their respective opening, movement and closing. What needs to happen is have a combined figure and show that in it's own section in the pivot table. So there will be 03 or combined which will be the total opening/movement/closing. I'm not sure how to achieve this with an IF statement in the Expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OR&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have this calculation done in the script and hold it under the 03 company ID, so that I can then add it into the pivot table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you will see, if you go into the pivot chart properties and look at the expressions, I selected the Opening/Movement/Closing as an expression, so that it appears in the desired way in our pivot table. I basically want to have 3 separate showings of Opening/Movement/Closing, but the 3rd showing will be the totals of 01 and 02.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally, I'd like the calculations done in the script as I believe this will be easier/quicker?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this make sense with what I am trying to achieve?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 11:23:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618170#M445572</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2019-08-29T11:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation in script based on a field but hold calculation against a new ID</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618220#M445577</link>
      <description>&lt;P&gt;Is there a reason you don't use Sum([OPENING BALANCE FOR YEAR]) instead of&amp;nbsp;[OPENING BALANCE FOR YEAR]... because if you use&amp;nbsp;Sum([OPENING BALANCE FOR YEAR]), you can enable total to see this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/18108i154E7EAE9E830583/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 12:32:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618220#M445577</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-08-29T12:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation in script based on a field but hold calculation against a new ID</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618225#M445578</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for your reply. That's a good point, I didn't think of that. Let me try it in my main application with the sensitive data and I will get back to you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bear with me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 12:36:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618225#M445578</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2019-08-29T12:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation in script based on a field but hold calculation against a new ID</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618244#M445582</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks like your method worked. I have checked it and seems to be correct. Thank you very much for your assistance. I will raise another help case if required but great stuff.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 13:07:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-in-script-based-on-a-field-but-hold-calculation/m-p/1618244#M445582</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2019-08-29T13:07:52Z</dc:date>
    </item>
  </channel>
</rss>

