<?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 Create a filtered table with WHERE NOT EXIST in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-a-filtered-table-with-WHERE-NOT-EXIST/m-p/356404#M132287</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;Athlete:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AthleteID&amp;nbsp; as all_AthleteID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AthleteID as&amp;nbsp; all_TookPartAthleteID,&lt;/P&gt;&lt;P&gt;/&amp;nbsp;&amp;nbsp; HomeRunID as all_HomeRunID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Athlete.qvd&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TookPartAthleteID as all_AthleteID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SeriesRaceEventKey as DTPSeriesRaceEventKey &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;TookPart.qvd &lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;where exists(all_TookPartAthleteID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create a new table where all of the athletes in the Athlete table are not present in the Result table.&lt;/P&gt;&lt;P&gt;This table to be called did_not_table part&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried various ways but I dont seem to get it right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help most appreciated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2012 15:33:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-03-16T15:33:35Z</dc:date>
    <item>
      <title>Create a filtered table with WHERE NOT EXIST</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-filtered-table-with-WHERE-NOT-EXIST/m-p/356404#M132287</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;Athlete:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AthleteID&amp;nbsp; as all_AthleteID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AthleteID as&amp;nbsp; all_TookPartAthleteID,&lt;/P&gt;&lt;P&gt;/&amp;nbsp;&amp;nbsp; HomeRunID as all_HomeRunID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Athlete.qvd&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TookPartAthleteID as all_AthleteID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SeriesRaceEventKey as DTPSeriesRaceEventKey &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;TookPart.qvd &lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;where exists(all_TookPartAthleteID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create a new table where all of the athletes in the Athlete table are not present in the Result table.&lt;/P&gt;&lt;P&gt;This table to be called did_not_table part&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried various ways but I dont seem to get it right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help most appreciated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 15:33:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-filtered-table-with-WHERE-NOT-EXIST/m-p/356404#M132287</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-16T15:33:35Z</dc:date>
    </item>
    <item>
      <title>Create a filtered table with WHERE NOT EXIST</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-filtered-table-with-WHERE-NOT-EXIST/m-p/356405#M132288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my experience, where not exists is very finicky with aliases.&amp;nbsp; Here's how I ended up getting the results you are looking for (hopefully):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the script I created inline tables to simulate your Athlete.qvd and TookPart.qvd because I do not have access to them on my end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AthleteTemp:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;AthleteID, HomeRunID&lt;/P&gt;&lt;P&gt;1, 1&lt;/P&gt;&lt;P&gt;2, 2&lt;/P&gt;&lt;P&gt;3, 3&lt;/P&gt;&lt;P&gt;4, 4&lt;/P&gt;&lt;P&gt;5, 5&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store * From AthleteTemp into Athlete.qvd;&lt;/P&gt;&lt;P&gt;drop table AthleteTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ResultTemp:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;TookPartAthleteID, SeriesRaceEventKey&lt;/P&gt;&lt;P&gt;5, 3&lt;/P&gt;&lt;P&gt;6, 4&lt;/P&gt;&lt;P&gt;7, 8&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store * From ResultTemp into Result.qvd;&lt;/P&gt;&lt;P&gt;drop table ResultTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now Athlete and Result are in the same format that you have.&amp;nbsp; So next you need to alias everything in the tables and store them into qvds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Athlete:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AthleteID&amp;nbsp; as all_AthleteID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AthleteID as&amp;nbsp; all_TookPartAthleteID,&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;&amp;nbsp;&amp;nbsp;HomeRunID as all_HomeRunID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\BApperson\Desktop\Athlete.qvd&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE * FROM Athlete into AthleteFinal.qvd;&lt;/P&gt;&lt;P&gt;drop table Athlete;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TookPartAthleteID as all_AthleteID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SeriesRaceEventKey as DTPSeriesRaceEventKey&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\BApperson\Desktop\Result.qvd&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE * FROM Result into ResultFinal.qvd;&lt;/P&gt;&lt;P&gt;drop table Result;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you just load these tables and perform the exists / not exists function in a normal fashion...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AthleteAliased:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD all_AthleteID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; all_TookPartAthleteID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; all_HomeRunID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\BApperson\Desktop\AthleteFinal.qvd&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did_not_table:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD all_AthleteID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DTPSeriesRaceEventKey&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\BApperson\Desktop\ResultFinal.qvd&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;WHERE NOT EXISTS(all_AthleteID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table AthleteAliased;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now your resulting set will be in the did_not_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case the resulting set is just ID's 6 and 7 as they do not exist in the first table but 5 does so it is omitted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 17:24:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-filtered-table-with-WHERE-NOT-EXIST/m-p/356405#M132288</guid>
      <dc:creator />
      <dc:date>2012-03-16T17:24:28Z</dc:date>
    </item>
  </channel>
</rss>

