<?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: join based on previously loaded table (where exists) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/join-based-on-previously-loaded-table-where-exists/m-p/959196#M645359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you need a &lt;STRONG&gt;left&lt;/STRONG&gt; join between &lt;EM&gt;Trackinghistory&lt;/EM&gt; and &lt;EM&gt;Profiles_Evalanche&lt;/EM&gt; and technically you could do a join to a source-table like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;facts:&lt;/P&gt;&lt;P&gt;Load * From x;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (left/right/inner) join&lt;/P&gt;&lt;P&gt;Load Fields ... Resident facts;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in your case it seems to make no sense or at least I didn't understand it. Maybe you need now more a second load from facts to fill the NULL from the missing %pool_Id with the Medium_ID or a string like 'NULL':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;facts_2:&lt;/P&gt;&lt;P&gt;noconcatenate load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Medium_ID, %profile_id, TrackingCount,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(len(trim(%pool_id))=0, 'NULL', %pool_id) as %pool_id&lt;/P&gt;&lt;P&gt;Resident facts;&lt;/P&gt;&lt;P&gt;drop table facts;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 Dec 2015 00:11:27 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2015-12-19T00:11:27Z</dc:date>
    <item>
      <title>join based on previously loaded table (where exists)</title>
      <link>https://community.qlik.com/t5/QlikView/join-based-on-previously-loaded-table-where-exists/m-p/959195#M645358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to join a %pool_id to a table based on two different conditions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Step 0. Load Facts&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Facts:&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resource_id as Medium_ID,&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; profile_id as %profile_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '1' as TrackingCount &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\0000_Ressources\QVD\Trackinghistory\*.qvd]&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp; //Step 1. check whether in the loaded facts table a %profile_id exists and match this to the profiles table where a link between %profile_id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //and %pool_id exists&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;join (Facts)&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;%profile_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %pool_id&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;QVD\Profiles_Evalanche.qvd&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt; //Step 2. Since not all facts have a %profile_id and, additionally, some %profile_id cannot be mapped to a %pool_id, I would like to use the&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //%pool_id that are mentioned in a Resources table (where the different mediums are described) as an additional way to connect the&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //tracking entry via its Medium_id to the %pool_id&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;join (Facts)&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;Medium_ID,&lt;/P&gt;&lt;P&gt;pool_id as %pool_id&lt;/P&gt;&lt;P&gt;resident &lt;/P&gt;&lt;P&gt;Resources&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Intuitively, I would do step 1 and afterwords join step 2 on the condition that no %pool_id was joined during step 1. However, I do not know how I can reference back to a previously loaded table (i.e. the Facts table). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please help? I would very much appreciate a fast anwer as this topic has to be handed in on Monday &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;@@&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 22:27:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/join-based-on-previously-loaded-table-where-exists/m-p/959195#M645358</guid>
      <dc:creator />
      <dc:date>2015-12-18T22:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: join based on previously loaded table (where exists)</title>
      <link>https://community.qlik.com/t5/QlikView/join-based-on-previously-loaded-table-where-exists/m-p/959196#M645359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you need a &lt;STRONG&gt;left&lt;/STRONG&gt; join between &lt;EM&gt;Trackinghistory&lt;/EM&gt; and &lt;EM&gt;Profiles_Evalanche&lt;/EM&gt; and technically you could do a join to a source-table like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;facts:&lt;/P&gt;&lt;P&gt;Load * From x;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (left/right/inner) join&lt;/P&gt;&lt;P&gt;Load Fields ... Resident facts;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in your case it seems to make no sense or at least I didn't understand it. Maybe you need now more a second load from facts to fill the NULL from the missing %pool_Id with the Medium_ID or a string like 'NULL':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;facts_2:&lt;/P&gt;&lt;P&gt;noconcatenate load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Medium_ID, %profile_id, TrackingCount,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(len(trim(%pool_id))=0, 'NULL', %pool_id) as %pool_id&lt;/P&gt;&lt;P&gt;Resident facts;&lt;/P&gt;&lt;P&gt;drop table facts;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Dec 2015 00:11:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/join-based-on-previously-loaded-table-where-exists/m-p/959196#M645359</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-12-19T00:11:27Z</dc:date>
    </item>
  </channel>
</rss>

