<?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: Calculating fields in load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459158#M1161411</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;do this...&lt;/P&gt;&lt;P&gt;load exchange rates table as mapping load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Exchange_Rates:&lt;BR /&gt;Mapping LOAD&lt;BR /&gt;[CURRENCY KEY] as KEY_Currency,&lt;BR /&gt;[EXCHANGE RATE] as Exchange_Rate&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;&lt;Z&gt;&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/Z&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Master_General:&lt;BR /&gt;LOAD&lt;BR /&gt;[Employee ID] as EMP_ID,&lt;BR /&gt;[Annual Salary Amount] as EMP_Salary&lt;BR /&gt;[CURRENCY KEY] as KEY_Currency,&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Applymap('&lt;CODE class="jive-code"&gt;Exchange_Rates&lt;/CODE&gt;',[CURRENCY KEY]) As Exchange_Rate,&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt; [&lt;CODE class="jive-code"&gt;Annual Salary Amount] * &lt;CODE class="jive-code"&gt;Applymap('&lt;CODE class="jive-code"&gt;Exchange_Rates&lt;/CODE&gt;',[CURRENCY KEY]) As Atcual_Salary&lt;/CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;FROM&lt;BR /&gt;&lt;Z&gt;&lt;BR /&gt;(ooxml, embedded labels, table is General);&lt;/Z&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Niranjan M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Dec 2012 04:42:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-12-21T04:42:38Z</dc:date>
    <item>
      <title>Calculating fields in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459157#M1161410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have loaded a table that looks like this...&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13560495667853536" jivemacro_uid="_13560495667853536"&gt;&lt;P&gt;Master_General:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[Employee ID] as EMP_ID,&lt;/P&gt;&lt;P&gt;[Annual Salary Amount] as EMP_Salary&lt;/P&gt;&lt;P&gt;[CURRENCY KEY] as KEY_Currency,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;Z&gt;&lt;/Z&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is General);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and another loaded table that looks like this...&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13560499202732571" jivemacro_uid="_13560499202732571"&gt;&lt;P&gt;Exchange_Rates:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[CURRENCY KEY] as KEY_Currency,&lt;/P&gt;&lt;P&gt;[EXCHANGE RATE] as Exchange_Rate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;Z&gt;&lt;/Z&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to calculate a field in the load script like EMP_Salary * Exchange_Rate.&amp;nbsp; But I don't know the proper syntax.&lt;/P&gt;&lt;P&gt;Do I use an INLINE load?&amp;nbsp; Do I need to use RESIDENT?&amp;nbsp; Do I need to create and then drop a temporary table? Do I need to have both tables load before I can complete these calculations?&amp;nbsp; Could someone please provide a simple example that illustrates and explains these things.&amp;nbsp; I can't figure them out from other posts.&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 00:39:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459157#M1161410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-21T00:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating fields in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459158#M1161411</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;do this...&lt;/P&gt;&lt;P&gt;load exchange rates table as mapping load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Exchange_Rates:&lt;BR /&gt;Mapping LOAD&lt;BR /&gt;[CURRENCY KEY] as KEY_Currency,&lt;BR /&gt;[EXCHANGE RATE] as Exchange_Rate&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;&lt;Z&gt;&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/Z&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Master_General:&lt;BR /&gt;LOAD&lt;BR /&gt;[Employee ID] as EMP_ID,&lt;BR /&gt;[Annual Salary Amount] as EMP_Salary&lt;BR /&gt;[CURRENCY KEY] as KEY_Currency,&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Applymap('&lt;CODE class="jive-code"&gt;Exchange_Rates&lt;/CODE&gt;',[CURRENCY KEY]) As Exchange_Rate,&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt; [&lt;CODE class="jive-code"&gt;Annual Salary Amount] * &lt;CODE class="jive-code"&gt;Applymap('&lt;CODE class="jive-code"&gt;Exchange_Rates&lt;/CODE&gt;',[CURRENCY KEY]) As Atcual_Salary&lt;/CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;FROM&lt;BR /&gt;&lt;Z&gt;&lt;BR /&gt;(ooxml, embedded labels, table is General);&lt;/Z&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Niranjan M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 04:42:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459158#M1161411</guid>
      <dc:creator />
      <dc:date>2012-12-21T04:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating fields in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459159#M1161412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this is right way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 07:03:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459159#M1161412</guid>
      <dc:creator />
      <dc:date>2012-12-21T07:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating fields in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459160#M1161413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp; This helps, but when I use a mapping load it drops the table automatically after script execution.&amp;nbsp; How can I accomplish the same thing if I have a larger table than Exchange_Rates and I don't want it dropped?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 13:06:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459160#M1161413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-21T13:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating fields in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459161#M1161414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just load the table as a regular table too. As long as your master_general table and your exchange_rates table both have a field with the same name, e.g. KEY_Currency the tables will be associated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 13:49:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459161#M1161414</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-12-21T13:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating fields in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459162#M1161415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do mean load Exchange_Rates twice--once as a mapping load and once as a normal load?&amp;nbsp; If not, can you provide an example with full syntax to show how I could calculate a field in the script without using mapping loads?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 13:53:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-fields-in-load-script/m-p/459162#M1161415</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-21T13:53:09Z</dc:date>
    </item>
  </channel>
</rss>

