<?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: Where not exists - How to SQL? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953057#M648474</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think u misunderstood my questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanna know how i can do the same logic in SQL. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2015 11:56:07 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-09-15T11:56:07Z</dc:date>
    <item>
      <title>Where not exists - How to SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953055#M648472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a bizzare scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table (and many other rows i dont wanna mention)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;D_Key&lt;/P&gt;&lt;P&gt;D_Key as Fod_Key_1&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;Transaktioner&lt;/P&gt;&lt;P&gt;where type = 'f'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate (t1)&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;D_Key&lt;/P&gt;&lt;P&gt;D_Key as Fod_Key_1&lt;/P&gt;&lt;P&gt;from Transaktioner&lt;/P&gt;&lt;P&gt;where type = 'd'&lt;/P&gt;&lt;P&gt;and not exists(Fod_Key_1,D_Key)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop field FOD_KEY_1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I simply cannot figure out how to repliacte this logic into SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1 consists of 100.000 rows&lt;/P&gt;&lt;P&gt;And the concatenated table consists of 6.000.000 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As logic i would think when these two are concatenated there would be no less than 5.900.000 rows. However there is like only 5.600.000 rows when my scripts end?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 11:12:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953055#M648472</guid>
      <dc:creator />
      <dc:date>2015-09-15T11:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Where not exists - How to SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953056#M648473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;T1:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;D_Key&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;D_Key as Fod_Key_1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;from&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Transaktioner&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;where type = 'f'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;concatenate (t1)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;D_Key&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;D_Key as Fod_Key_1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;from Transaktioner&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;where type = 'd'&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;and not exists(D_Key)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 11:53:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953056#M648473</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-15T11:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Where not exists - How to SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953057#M648474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think u misunderstood my questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanna know how i can do the same logic in SQL. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 11:56:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953057#M648474</guid>
      <dc:creator />
      <dc:date>2015-09-15T11:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Where not exists - How to SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953058#M648475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not 100% sure if I understood you correctly, but try this to statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; *;&lt;/P&gt;&lt;P&gt;SQL Select DISTINCT&lt;/P&gt;&lt;P&gt;&amp;nbsp; D_Key&lt;/P&gt;&lt;P&gt;&amp;nbsp; D_Key as Fod_Key_1&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp; Transaktioner&lt;/P&gt;&lt;P&gt;where &lt;/P&gt;&lt;P&gt;&amp;nbsp; type = 'f'&lt;/P&gt;&lt;P&gt;&amp;nbsp; Or type = 'd'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first one may work if your requested fields are always the same (no matter if type is f or d).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; *;&lt;/P&gt;&lt;P&gt;SQL Select DISTINCT&lt;/P&gt;&lt;P&gt;&amp;nbsp; D_Key&lt;/P&gt;&lt;P&gt;&amp;nbsp; D_Key as Fod_Key_1&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp; Transaktioner&lt;/P&gt;&lt;P&gt;where &lt;/P&gt;&lt;P&gt;&amp;nbsp; type = 'f'&lt;/P&gt;&lt;P&gt;&amp;nbsp; Or (type = 'd' and not exists (Select 1 from Transaktioner t2 where type = f and Transaktioner.D_Key = t2.D_Key)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may not be the fastest solution, but at least it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Claus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 12:38:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953058#M648475</guid>
      <dc:creator />
      <dc:date>2015-09-15T12:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Where not exists - How to SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953059#M648476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But how come when i load this table for it self&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t2:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;D_key&lt;/P&gt;&lt;P&gt;,d_Key as Fod_Key_1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from transkationer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where not exists(fod_key_1,D_key) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it returns less rows? When fod_key_1, and d_key is the same?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when only loading one table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so without exists it has 6.000.000 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the exists it has 5.800.000 rows? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 12:46:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953059#M648476</guid>
      <dc:creator />
      <dc:date>2015-09-15T12:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Where not exists - How to SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953060#M648477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;D_key&lt;/P&gt;&lt;P&gt;,d_Key as Fod_Key_1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from transkationer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where not exists(D_key,D_key) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and see if it returns the correct records?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;actually you can not access aliases in the conditions.. My assumption is that it is probably eliminating null values. do you perhaps have nulls in that column?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;&lt;P&gt;Sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2015 08:54:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-not-exists-How-to-SQL/m-p/953060#M648477</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2015-09-16T08:54:11Z</dc:date>
    </item>
  </channel>
</rss>

