<?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: load same distinct key from 2 tables for where exists in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/load-same-distinct-key-from-2-tables-for-where-exists/m-p/415402#M698489</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did my code work? If so, please mark this thread as answered, as other people may find it useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jan 2013 16:17:31 GMT</pubDate>
    <dc:creator>fosuzuki</dc:creator>
    <dc:date>2013-01-11T16:17:31Z</dc:date>
    <item>
      <title>load same distinct key from 2 tables for where exists</title>
      <link>https://community.qlik.com/t5/QlikView/load-same-distinct-key-from-2-tables-for-where-exists/m-p/415399#M698486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello QV Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am checking to see if this code looks correct, I am not getting the expected results. I want to only load ContactKey where it exists in two tables dependent on various criteria. I also want to perform this more than once, but have the second iteration ignore the already loaded data. Is that possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Iteration1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;LOAD DISTINCT ContactKey&lt;/P&gt;&lt;P&gt;FROM fContact.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE RecordDate&amp;gt;=$(vMinDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN (T1)&lt;/P&gt;&lt;P&gt;LOAD DISTINCT ContactKey&lt;/P&gt;&lt;P&gt;FROM dContact.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE Description='Desc1';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Contact:&lt;/P&gt;&lt;P&gt;LOAD ContactKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Category1' AS Category,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContactName&amp;nbsp;&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 fContact.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE EXISTS (ContactKey);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE T1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Iteration2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T3:&lt;/P&gt;&lt;P&gt;LOAD DISTINCT ContactKey&lt;/P&gt;&lt;P&gt;FROM fContact.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE RecordDate&amp;gt;=$(vMinDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN (T3)&lt;/P&gt;&lt;P&gt;LOAD DISTINCT ContactKey&lt;/P&gt;&lt;P&gt;FROM dContact.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE Description='Desc2';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Contact:&lt;/P&gt;&lt;P&gt;LOAD ContactKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Category2' AS Category,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContactName&amp;nbsp;&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 fContact.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE EXISTS (ContactKey);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE T2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 15:44:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/load-same-distinct-key-from-2-tables-for-where-exists/m-p/415399#M698486</guid>
      <dc:creator />
      <dc:date>2013-01-11T15:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: load same distinct key from 2 tables for where exists</title>
      <link>https://community.qlik.com/t5/QlikView/load-same-distinct-key-from-2-tables-for-where-exists/m-p/415400#M698487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your second exists(ContactKey), it will check for values existing in table T3 and the first Contact table. I guess that you want to consider only the values from table T3, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13579203074222829" jivemacro_uid="_13579203074222829"&gt;&lt;P&gt;//Iteration2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T3:&lt;/P&gt;&lt;P&gt;LOAD DISTINCT ContactKey AS ContactKeyT3&lt;/P&gt;&lt;P&gt;FROM fContact.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE RecordDate&amp;gt;=$(vMinDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN (T3)&lt;/P&gt;&lt;P&gt;LOAD DISTINCT ContactKey&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt; AS ContactKeyT3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FROM dContact.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE Description='Desc2';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Contact:&lt;/P&gt;&lt;P&gt;LOAD ContactKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Category2' AS Category,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContactName&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 fContact.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE EXISTS (&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;ContactKeyT3, &lt;/SPAN&gt;ContactKey);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE T3;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 16:06:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/load-same-distinct-key-from-2-tables-for-where-exists/m-p/415400#M698487</guid>
      <dc:creator>fosuzuki</dc:creator>
      <dc:date>2013-01-11T16:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: load same distinct key from 2 tables for where exists</title>
      <link>https://community.qlik.com/t5/QlikView/load-same-distinct-key-from-2-tables-for-where-exists/m-p/415401#M698488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 16:11:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/load-same-distinct-key-from-2-tables-for-where-exists/m-p/415401#M698488</guid>
      <dc:creator />
      <dc:date>2013-01-11T16:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: load same distinct key from 2 tables for where exists</title>
      <link>https://community.qlik.com/t5/QlikView/load-same-distinct-key-from-2-tables-for-where-exists/m-p/415402#M698489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did my code work? If so, please mark this thread as answered, as other people may find it useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 16:17:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/load-same-distinct-key-from-2-tables-for-where-exists/m-p/415402#M698489</guid>
      <dc:creator>fosuzuki</dc:creator>
      <dc:date>2013-01-11T16:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: load same distinct key from 2 tables for where exists</title>
      <link>https://community.qlik.com/t5/QlikView/load-same-distinct-key-from-2-tables-for-where-exists/m-p/415403#M698490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beautiful, thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 17:25:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/load-same-distinct-key-from-2-tables-for-where-exists/m-p/415403#M698490</guid>
      <dc:creator />
      <dc:date>2013-01-11T17:25:14Z</dc:date>
    </item>
  </channel>
</rss>

