<?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 Foreign Keys - Merging two tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Foreign-Keys-Merging-two-tables/m-p/226971#M79112</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One approach:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;LEFT JOIN (CLIENTS)&lt;BR /&gt;LOAD DISTINCT NAME_MAIL_CITY AS CITY_CLIENT&lt;BR /&gt;,'OK' as TEMP_CITY_STATUS&lt;BR /&gt;RESIDENT MAIL_CITY&lt;BR /&gt;;&lt;BR /&gt;LEFT JOIN (CLIENTS)&lt;BR /&gt;LOAD&lt;BR /&gt; CODE_CLIENT&lt;BR /&gt;,if(TEMP_CITY_STATUS='OK','OK','ERROR') AS CITY_STATUS&lt;BR /&gt;RESIDENT CLIENTS&lt;BR /&gt;;&lt;BR /&gt;DROP FIELD TEMP_CITY_STATUS&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Another approach:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;CITYMAP:&lt;BR /&gt;MAPPING LOAD&lt;BR /&gt; DISTINCT NAME_MAIL_CITY&lt;BR /&gt;,'OK' AS CITY_STATUS&lt;BR /&gt;RESIDENT MAIL_CITY&lt;BR /&gt;;&lt;BR /&gt;CLIENTS:&lt;BR /&gt;LOAD *&lt;BR /&gt;,applymap('CITYMAP',CITY_CLIENT,'ERROR') AS CITY_STATUS&lt;BR /&gt;FROM TEST158P.CSV (ANSI, TXT, DELIMITER IS ';', EMBEDDED LABELS, NO QUOTES);&lt;/P&gt;&lt;P&gt;Another approach:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;CLIENTS:&lt;BR /&gt;LOAD *&lt;BR /&gt;,if(exists(NAME_MAIL_CITY,CITY_CLIENT),'OK','ERROR') AS CITY_STATUS&lt;BR /&gt;FROM TEST158P.CSV (ANSI, TXT, DELIMITER IS ';', EMBEDDED LABELS, NO QUOTES);&lt;/P&gt;&lt;P&gt;You'd have to experiment to see which is fastest on your actual data. I'm betting #3, and it's the simplest too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Apr 2010 19:14:15 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2010-04-28T19:14:15Z</dc:date>
    <item>
      <title>Foreign Keys - Merging two tables</title>
      <link>https://community.qlik.com/t5/QlikView/Foreign-Keys-Merging-two-tables/m-p/226970#M79111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello !&lt;/P&gt;&lt;P&gt;A typical problem for me is like this :&lt;/P&gt;&lt;P&gt;Say that you have a clients database with a CITY ADDRESS field.&lt;/P&gt;&lt;P&gt;Then you have another table with all of the CITIES NAMES . A table from the Email Company. All the valid city names.&lt;/P&gt;&lt;P&gt;I want to merge two tables creating a new field , CITY STATUS, that will be OK if the client CITY ADDRESS is found on the CITIES NAMES table. And I want status to be ERROR if the CITY ADDRESS is NOT FOUND on the other table.&lt;/P&gt;&lt;P&gt;How to do that ? Lookup is not a god solution cause the database is huge.&lt;/P&gt;&lt;P&gt;I have provided a sample application.&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 17:49:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Foreign-Keys-Merging-two-tables/m-p/226970#M79111</guid>
      <dc:creator />
      <dc:date>2010-04-28T17:49:02Z</dc:date>
    </item>
    <item>
      <title>Foreign Keys - Merging two tables</title>
      <link>https://community.qlik.com/t5/QlikView/Foreign-Keys-Merging-two-tables/m-p/226971#M79112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One approach:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;LEFT JOIN (CLIENTS)&lt;BR /&gt;LOAD DISTINCT NAME_MAIL_CITY AS CITY_CLIENT&lt;BR /&gt;,'OK' as TEMP_CITY_STATUS&lt;BR /&gt;RESIDENT MAIL_CITY&lt;BR /&gt;;&lt;BR /&gt;LEFT JOIN (CLIENTS)&lt;BR /&gt;LOAD&lt;BR /&gt; CODE_CLIENT&lt;BR /&gt;,if(TEMP_CITY_STATUS='OK','OK','ERROR') AS CITY_STATUS&lt;BR /&gt;RESIDENT CLIENTS&lt;BR /&gt;;&lt;BR /&gt;DROP FIELD TEMP_CITY_STATUS&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Another approach:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;CITYMAP:&lt;BR /&gt;MAPPING LOAD&lt;BR /&gt; DISTINCT NAME_MAIL_CITY&lt;BR /&gt;,'OK' AS CITY_STATUS&lt;BR /&gt;RESIDENT MAIL_CITY&lt;BR /&gt;;&lt;BR /&gt;CLIENTS:&lt;BR /&gt;LOAD *&lt;BR /&gt;,applymap('CITYMAP',CITY_CLIENT,'ERROR') AS CITY_STATUS&lt;BR /&gt;FROM TEST158P.CSV (ANSI, TXT, DELIMITER IS ';', EMBEDDED LABELS, NO QUOTES);&lt;/P&gt;&lt;P&gt;Another approach:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;CLIENTS:&lt;BR /&gt;LOAD *&lt;BR /&gt;,if(exists(NAME_MAIL_CITY,CITY_CLIENT),'OK','ERROR') AS CITY_STATUS&lt;BR /&gt;FROM TEST158P.CSV (ANSI, TXT, DELIMITER IS ';', EMBEDDED LABELS, NO QUOTES);&lt;/P&gt;&lt;P&gt;You'd have to experiment to see which is fastest on your actual data. I'm betting #3, and it's the simplest too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 19:14:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Foreign-Keys-Merging-two-tables/m-p/226971#M79112</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-28T19:14:15Z</dc:date>
    </item>
    <item>
      <title>Foreign Keys - Merging two tables</title>
      <link>https://community.qlik.com/t5/QlikView/Foreign-Keys-Merging-two-tables/m-p/226972#M79113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I prefer #3. It's the simplest one.&lt;/P&gt;&lt;P&gt;On the prototype it ran very fast.&lt;/P&gt;&lt;P&gt;I'll transport to the original application to see how fast or slow it goes.&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 20:37:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Foreign-Keys-Merging-two-tables/m-p/226972#M79113</guid>
      <dc:creator />
      <dc:date>2010-04-28T20:37:11Z</dc:date>
    </item>
    <item>
      <title>Foreign Keys - Merging two tables</title>
      <link>https://community.qlik.com/t5/QlikView/Foreign-Keys-Merging-two-tables/m-p/226973#M79114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed #3 ( if exists approach) is the best one.&lt;/P&gt;&lt;P&gt;Simple to understand and fast to run.&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 12:47:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Foreign-Keys-Merging-two-tables/m-p/226973#M79114</guid>
      <dc:creator />
      <dc:date>2010-04-29T12:47:41Z</dc:date>
    </item>
  </channel>
</rss>

