<?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: Multiple columns referring to same table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806115#M1047677</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;load twice the second table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load userid as createdbyid, username as usernamecreate, emailaddress as emailcreate resident ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333339691162px;"&gt;load userid as modifiedbyid, username as usernamemodif, emailaddress as emailmodif resident ...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Nov 2014 09:13:43 GMT</pubDate>
    <dc:creator>alexandros17</dc:creator>
    <dc:date>2014-11-11T09:13:43Z</dc:date>
    <item>
      <title>Multiple columns referring to same table</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806114#M1047676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having the following situation:&lt;/P&gt;&lt;P&gt;I have 2 tables in SQL, the first table contains faults and looks like this: (only shown related columns)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;faultId&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Description&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;createdById&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;modifiedById&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;description001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;userId001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;userId002&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;002&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;description002&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;userId003&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;userId003&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;003&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;description003&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;userId004&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the second contains users and looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;userId&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;username&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;emailAddress&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;userId001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;daveP&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;A class="jive-link-email-small" href="mailto:davep@mail.com"&gt;davep@mail.com&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;userId002&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;peterK&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;A class="jive-link-email-small" href="mailto:peterk@mail.com"&gt;peterk@mail.com&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;userId003&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;fredC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;A class="jive-link-email-small" href="mailto:fredc@mail.com"&gt;fredc@mail.com&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I can't name the columns in such a way that it would get connected automatically, as that would require me to name both createdById and modifiedById to 'userId' (right?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I connect these tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 09:04:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806114#M1047676</guid>
      <dc:creator />
      <dc:date>2014-11-11T09:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple columns referring to same table</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806115#M1047677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;load twice the second table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load userid as createdbyid, username as usernamecreate, emailaddress as emailcreate resident ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333339691162px;"&gt;load userid as modifiedbyid, username as usernamemodif, emailaddress as emailmodif resident ...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 09:13:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806115#M1047677</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2014-11-11T09:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple columns referring to same table</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806116#M1047678</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;If the userid table contains only a few fields (eg id, username and email address as per your post), then you can map these into the main table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapUserIdName:&lt;/P&gt;&lt;P&gt;Mapping Load userId, username&lt;/P&gt;&lt;P&gt;From Users;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapUserIdEmail:&lt;/P&gt;&lt;P&gt;Mapping Load userId, emailAddress&lt;/P&gt;&lt;P&gt;From Users;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Faults:&lt;/P&gt;&lt;P&gt;LOAD faultId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; createdById,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Applymap('mapUserIdName', createdById) As createdByUsername,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Applymap('mapUserIdEmail', createdById) As createdByEmail,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; modifiedById,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Applymap('mapUserIdName', modifiedById) As modifiedByUsername,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Applymap('mapUserIdEmail', modifiedById) As modifiedByEmail,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;From Faults;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 09:24:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806116#M1047678</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-11-11T09:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple columns referring to same table</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806117#M1047679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use lookup function in the first table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load second table first&lt;/P&gt;&lt;P&gt;then while loading the first table ... use look up function on the previous loaded table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chaitanya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 09:26:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806117#M1047679</guid>
      <dc:creator>ychaitanya</dc:creator>
      <dc:date>2014-11-11T09:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple columns referring to same table</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806118#M1047680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose that would do. However this creates duplicate data. The user table is not that big so it won't really decrease performance that much. Still I'd think there would be a more elegant solution (?).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 09:26:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806118#M1047680</guid>
      <dc:creator />
      <dc:date>2014-11-11T09:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple columns referring to same table</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806119#M1047681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems the best solution, however I can not get the syntax right. I am using a SQL database, and have incorparated your part of the code in the following way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapUserIdName:&lt;/P&gt;&lt;P&gt;Mapping SQL SELECT Id, Username&lt;/P&gt;&lt;P&gt;From "myDataBase".dbo.Users;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapUserIdEmail:&lt;/P&gt;&lt;P&gt;Mapping SQL SELECT Id, EmailAddress&lt;/P&gt;&lt;P&gt;From "myDataBase".dbo.Users;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Faults:&lt;/P&gt;&lt;P&gt;SQL SELECT ContractorId,&lt;/P&gt;&lt;P&gt;&amp;nbsp; CreatedAt,&lt;/P&gt;&lt;P&gt;&amp;nbsp; CreatedById,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Applymap('mapUserIdName', createdById) As createdByUsername,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Applymap('mapUserIdEmail', createdById) As createdByEmail,&lt;/P&gt;&lt;P&gt;&amp;nbsp; ModifiedAt,&lt;/P&gt;&lt;P&gt;&amp;nbsp; ModifiedById,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Applymap('mapUserIdName', modifiedById) As modifiedByUsername,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Applymap('mapUserIdEmail', modifiedById) As modifiedByEmail,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description as FaultDescription,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Id as FaultId&lt;/P&gt;&lt;P&gt;FROM "myDataBase".dbo.Faults;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recieve the following error:&lt;/P&gt;&lt;P&gt;ErrorMsg: 'Applymap' is not a recognized built-in function name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How should I apply the mapping instead?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 10:00:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806119#M1047681</guid>
      <dc:creator />
      <dc:date>2014-11-11T10:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple columns referring to same table</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806120#M1047682</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;Everything from the SQL command to the closing ; is sent to the DBMS. Applymap is a QV function, not a SQL function, so you need something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Faults:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD *,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Applymap('mapUserIdName', createdById) As createdByUsername,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Applymap('mapUserIdEmail', createdById) As createdByEmail,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Applymap('mapUserIdName', modifiedById) As modifiedByUsername,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Applymap('mapUserIdEmail', modifiedById) As modifiedByEmail;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SQL SELECT ContractorId,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; CreatedAt,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; CreatedById,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ModifiedAt,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ModifiedById,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Description as FaultDescription,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Id as FaultId&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM "myDataBase".dbo.Faults;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 05:25:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-columns-referring-to-same-table/m-p/806120#M1047682</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-11-12T05:25:52Z</dc:date>
    </item>
  </channel>
</rss>

