<?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: ApplyMap function with imported SQL file only in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/ApplyMap-function-with-imported-SQL-file-only/m-p/816851#M662698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I realized the issue was with the infinite loop but I wanted to apply my applymap knowledge elsewhere:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MapExchangeRate:&lt;/P&gt;&lt;P&gt;Load CurrencyID, ExchangeRate;&lt;/P&gt;&lt;P&gt;Select ID as CurrencyID, ExchangeRate&lt;/P&gt;&lt;P&gt;From Currency;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FlowItem:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;ApplyMap('MapExchangeRate', CurrencyID) as CurrencyExchange;&lt;/P&gt;&lt;P&gt;SELECT FlowID, CurrencyID, ProductID, Price as FlowItemPrice, TargetGroupID, CampaignStart as FlowItemCampaignStart, CampaignStop as FlowItemCampaignStop&lt;/P&gt;&lt;P&gt;From FlowItem;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This doesn't return any 'compile' errors on another duo of tables but the "CurrencyExchange" is always empty when I add it to a table (which should never be the case as the fields are not nullable).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Screenie of my qlik structure looks correct as well: &lt;A class="unlinked" title="http://i.imgur.com/VIRiFoH.png"&gt;http://i.imgur.com/VIRiFoH.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also want to manipulate the translated field IE FlowItemPrice * ExchangeRate (as introduced into the table) but I'm unsure how.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Feb 2015 11:05:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-02-04T11:05:30Z</dc:date>
    <item>
      <title>ApplyMap function with imported SQL file only</title>
      <link>https://community.qlik.com/t5/QlikView/ApplyMap-function-with-imported-SQL-file-only/m-p/816848#M662695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all - I'm having qlik problems with a common field between several tables and naturally I googled the issue as it seemed counter-intuitive for my having to write a join myself - and found articles similar to these: &lt;A href="https://community.qlik.com/qlik-blogpost/2756"&gt;Don't join - use Applymap instead&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which are excellent! Except I'm unsure of the correct syntax since I've imported an sql file and the tutorials I've seen does not account for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have in qlik is a table structure as: &lt;A href="http://i.imgur.com/pKTMhuw.png" title="http://i.imgur.com/pKTMhuw.png"&gt;http://i.imgur.com/pKTMhuw.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;What I need is for the user to be linked to the company, like so: &lt;A href="http://i.imgur.com/YT8bO9T.png" title="http://i.imgur.com/YT8bO9T.png"&gt;http://i.imgur.com/YT8bO9T.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However since the user is a common field, qlik is calling some ambiguous loop error and causing me issues when I try connect user to company (and activity).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Applymap I've done:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MapUserNametoCompany:&lt;/P&gt;&lt;P&gt;Mapping Load UserID, UserName;&lt;/P&gt;&lt;P&gt;select ID as UserID, Name as UserName&lt;/P&gt;&lt;P&gt;From User;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Company:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;ApplyMap('MapUserNametoCompany', UserID, null()) as UserName;&lt;/P&gt;&lt;P&gt;SELECT ID as CompanyID, CountryID, Name as CompanyName&lt;/P&gt;&lt;P&gt;From Company;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But of course it complains that there is no common field of UserID in the Company table (which is the whole reason I'm looking for an alternative to a join in the first place), which I understand, but am I'm a little confused as to how to apply ApplyMap now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In these situations how would you handle this? If ApplyMap is the solution could you please explain to me how (without attaching files as I'm using the trial version for my first project) and I would be eternally grateful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;raz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 16:54:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ApplyMap-function-with-imported-SQL-file-only/m-p/816848#M662695</guid>
      <dc:creator />
      <dc:date>2015-02-03T16:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyMap function with imported SQL file only</title>
      <link>https://community.qlik.com/t5/QlikView/ApplyMap-function-with-imported-SQL-file-only/m-p/816849#M662696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your statement&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Company:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load *,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ApplyMap('MapUserNametoCompany', UserID, null()) as UserName;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SELECT ID as CompanyID, CountryID, Name as CompanyName&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;From Company;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;does not work, since you are not retrieving an UserID from Company table, UserID should be in your select clause&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 18:08:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ApplyMap-function-with-imported-SQL-file-only/m-p/816849#M662696</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2015-02-03T18:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyMap function with imported SQL file only</title>
      <link>https://community.qlik.com/t5/QlikView/ApplyMap-function-with-imported-SQL-file-only/m-p/816850#M662697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have a table User with CompanyID and you want to add the CompanyName to the UserID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MapCompany:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load CompanyID, CompanyName;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SELECT ID as CompanyID, Name as CompanyName&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;From Company;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;User:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserID, UserName,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // add company name using company id&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; applymap('MapCompany', ???&lt;STRONG&gt;companyid&lt;/STRONG&gt;???) as UserCompanyName&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;select ID as UserID, Name as UserName, ???&lt;STRONG&gt;companyid&lt;/STRONG&gt;???&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;From User;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 19:09:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ApplyMap-function-with-imported-SQL-file-only/m-p/816850#M662697</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-02-03T19:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyMap function with imported SQL file only</title>
      <link>https://community.qlik.com/t5/QlikView/ApplyMap-function-with-imported-SQL-file-only/m-p/816851#M662698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I realized the issue was with the infinite loop but I wanted to apply my applymap knowledge elsewhere:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MapExchangeRate:&lt;/P&gt;&lt;P&gt;Load CurrencyID, ExchangeRate;&lt;/P&gt;&lt;P&gt;Select ID as CurrencyID, ExchangeRate&lt;/P&gt;&lt;P&gt;From Currency;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FlowItem:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;ApplyMap('MapExchangeRate', CurrencyID) as CurrencyExchange;&lt;/P&gt;&lt;P&gt;SELECT FlowID, CurrencyID, ProductID, Price as FlowItemPrice, TargetGroupID, CampaignStart as FlowItemCampaignStart, CampaignStop as FlowItemCampaignStop&lt;/P&gt;&lt;P&gt;From FlowItem;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This doesn't return any 'compile' errors on another duo of tables but the "CurrencyExchange" is always empty when I add it to a table (which should never be the case as the fields are not nullable).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Screenie of my qlik structure looks correct as well: &lt;A class="unlinked" title="http://i.imgur.com/VIRiFoH.png"&gt;http://i.imgur.com/VIRiFoH.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also want to manipulate the translated field IE FlowItemPrice * ExchangeRate (as introduced into the table) but I'm unsure how.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 11:05:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ApplyMap-function-with-imported-SQL-file-only/m-p/816851#M662698</guid>
      <dc:creator />
      <dc:date>2015-02-04T11:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyMap function with imported SQL file only</title>
      <link>https://community.qlik.com/t5/QlikView/ApplyMap-function-with-imported-SQL-file-only/m-p/816852#M662699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to specify your mapping table as such, therefore, the code should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MapExchangeRate:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Mapping&lt;/STRONG&gt; Load CurrencyID, ExchangeRate;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Select ID as CurrencyID, ExchangeRate&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;From Currency;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;In your example, there is no error when the script is run even though the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;MapExchangeRate table is not a mapping table.&amp;nbsp; QlikView just ignores errors with ApplyMap and populates the field with a null.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 08:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ApplyMap-function-with-imported-SQL-file-only/m-p/816852#M662699</guid>
      <dc:creator>beanmachine</dc:creator>
      <dc:date>2015-08-31T08:04:35Z</dc:date>
    </item>
  </channel>
</rss>

