<?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: Calculate 2 fields in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531259#M1140229</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use applymap and bring the field you need from 2nd table to 1st table. Then do preceding load in 1st table and calculate the sum. That's the way I have done in many instances and it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Rajesh Vaswani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Sep 2013 05:16:02 GMT</pubDate>
    <dc:creator>rajeshvaswani77</dc:creator>
    <dc:date>2013-09-18T05:16:02Z</dc:date>
    <item>
      <title>Calculate 2 fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531253#M1140223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i load 2 tables in a script. E.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1: contains field a&lt;/P&gt;&lt;P&gt;T2: contains filed b&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want to subtract field a from field b as a new one. E.g. sum(a-b) as c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible in my script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 13:46:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531253#M1140223</guid>
      <dc:creator />
      <dc:date>2013-09-17T13:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2 fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531254#M1140224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's only possible if you first combine the two tables into one table. You can use &lt;EM&gt;join&lt;/EM&gt; for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 13:57:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531254#M1140224</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-09-17T13:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2 fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531255#M1140225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;T1: contains field a&lt;/P&gt;&lt;P&gt;join(T1)&lt;/P&gt;&lt;P&gt;T2: contains filed b&lt;/P&gt;&lt;P&gt;and need&lt;/P&gt;&lt;P&gt;T3:&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;a,&lt;/P&gt;&lt;P&gt;b,&lt;/P&gt;&lt;P&gt;a+b as c&lt;/P&gt;&lt;P&gt;resident T1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 14:20:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531255#M1140225</guid>
      <dc:creator>yevgeniy</dc:creator>
      <dc:date>2013-09-17T14:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2 fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531256#M1140226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Do you want to calculate all combinations possible of sum(a-b)?&lt;/P&gt;&lt;P&gt;If so, you can do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JOIN(T1)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;b&lt;/P&gt;&lt;P&gt;RESIDENT&lt;/P&gt;&lt;P&gt;T2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll now have your field a and b in the table T1 and you can do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;(T1)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;sum(a-b)&lt;/P&gt;&lt;P&gt;RESIDENT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; T1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, you should have at least one field in common in table T1 and T2 which will let you join field a to b.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain little more your need? And even join your qvw will be better.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 14:40:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531256#M1140226</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-17T14:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2 fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531257#M1140227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have one field in common in both tables. Its 'part_no'. In table T1 is the stock in table T2 is the safety stock.&lt;/P&gt;&lt;P&gt;And now i need the difference between stock and safety stock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you support guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 04:46:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531257#M1140227</guid>
      <dc:creator />
      <dc:date>2013-09-18T04:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2 fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531258#M1140228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Load part_no,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stock&lt;/P&gt;&lt;P&gt;From &amp;lt;your source&amp;gt;;&lt;/P&gt;&lt;P&gt;Join&amp;nbsp;&amp;nbsp; // left/right/inner whicever is applicable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load part_no,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Safety&lt;/P&gt;&lt;P&gt;From &amp;lt;your source&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Stock-Safety) as Difference&lt;/P&gt;&lt;P&gt;Resident Table1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Table1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 04:56:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531258#M1140228</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-09-18T04:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2 fields in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531259#M1140229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use applymap and bring the field you need from 2nd table to 1st table. Then do preceding load in 1st table and calculate the sum. That's the way I have done in many instances and it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Rajesh Vaswani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 05:16:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-2-fields-in-script/m-p/531259#M1140229</guid>
      <dc:creator>rajeshvaswani77</dc:creator>
      <dc:date>2013-09-18T05:16:02Z</dc:date>
    </item>
  </channel>
</rss>

