<?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 Help with 'where not exists' in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-where-not-exists/m-p/350702#M704064</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a query that runs like a dog, mainly due to a where condition similar to this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND c.uidcot not in (select z.uidcot FROM table1 Inner join table2 inner join table 3 where a=b and b=c and d=f)&amp;nbsp; you get the point&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my plan was to move that nested select statement to it's own LOAD, and then in another LOAD bring in the core data, but place a WHERE NOT EXISTS (uidcot).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ExcludeUID:&lt;/P&gt;&lt;P&gt;LOAD uidcot;&lt;/P&gt;&lt;P&gt;SQL SELECT....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;uidcot,&lt;/P&gt;&lt;P&gt;field1,&lt;/P&gt;&lt;P&gt;field2&lt;/P&gt;&lt;P&gt;WHERE NOT EXISTS (uidcot);&lt;/P&gt;&lt;P&gt;SQL SELECT .....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now this worked, but with a hitch..&amp;nbsp; What I only just learnt is that the WHERE NOT EXISTS checks Data as well.. It makes sense, but it somehow never occured to me that it would do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what I need to do is force the WHERE NOT EXISTS to only compare against the ExcludeUID table.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is that done..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 May 2012 02:06:51 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-15T02:06:51Z</dc:date>
    <item>
      <title>Help with 'where not exists'</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-where-not-exists/m-p/350702#M704064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a query that runs like a dog, mainly due to a where condition similar to this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND c.uidcot not in (select z.uidcot FROM table1 Inner join table2 inner join table 3 where a=b and b=c and d=f)&amp;nbsp; you get the point&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my plan was to move that nested select statement to it's own LOAD, and then in another LOAD bring in the core data, but place a WHERE NOT EXISTS (uidcot).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ExcludeUID:&lt;/P&gt;&lt;P&gt;LOAD uidcot;&lt;/P&gt;&lt;P&gt;SQL SELECT....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;uidcot,&lt;/P&gt;&lt;P&gt;field1,&lt;/P&gt;&lt;P&gt;field2&lt;/P&gt;&lt;P&gt;WHERE NOT EXISTS (uidcot);&lt;/P&gt;&lt;P&gt;SQL SELECT .....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now this worked, but with a hitch..&amp;nbsp; What I only just learnt is that the WHERE NOT EXISTS checks Data as well.. It makes sense, but it somehow never occured to me that it would do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what I need to do is force the WHERE NOT EXISTS to only compare against the ExcludeUID table.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is that done..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2012 02:06:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-where-not-exists/m-p/350702#M704064</guid>
      <dc:creator />
      <dc:date>2012-05-15T02:06:51Z</dc:date>
    </item>
    <item>
      <title>Help with 'where not exists'</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-where-not-exists/m-p/350703#M704065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to use the second form of exists - comparing an expression to a field. Rename the other field, and compare one field to another:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ExcludeUID:&lt;/P&gt;&lt;P&gt;LOAD uidcot as uidcot_excl;&lt;/P&gt;&lt;P&gt;SQL SELECT....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;uidcot,&lt;/P&gt;&lt;P&gt;field1,&lt;/P&gt;&lt;P&gt;field2&lt;/P&gt;&lt;P&gt;WHERE NOT EXISTS (uidcot_excl, uidcot);&lt;/P&gt;&lt;P&gt;SQL SELECT .....;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2012 02:12:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-where-not-exists/m-p/350703#M704065</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2012-05-15T02:12:50Z</dc:date>
    </item>
  </channel>
</rss>

