<?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: Exists function in Qlikview vs SQL in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Exists-function-in-Qlikview-vs-SQL/m-p/1244034#M868775</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;Qlikview:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us assume we have tables like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose if you want to load the ID in Table2 which are in Table1 then use below script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FROM Table1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FROM Table2&lt;/P&gt;&lt;P&gt;WHERE Exists(ID); // It will load only 1, 3,5 and filter out 6 because it is not available in Table1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more example:&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you dont want to load duplicate rows then use below script&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;*&lt;/P&gt;&lt;P&gt;FROM Table1&lt;/P&gt;&lt;P&gt;WHERE NOT Exists(ID);&amp;nbsp; // It will load 1 and 5 only once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this type of scenarios we use Exists in qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The purpose of Exists() is same in both QV and SQL, the only difference is the way of using it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM Table1 AS s&amp;nbsp; &lt;/P&gt;&lt;P&gt;WHERE EXISTS&amp;nbsp; &lt;/P&gt;&lt;P&gt;(SELECT ID&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM Table2 b&lt;/P&gt;&lt;P&gt;&amp;nbsp; WHERE a.ID = b.ID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Dec 2016 05:42:08 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2016-12-12T05:42:08Z</dc:date>
    <item>
      <title>Exists function in Qlikview vs SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Exists-function-in-Qlikview-vs-SQL/m-p/1244033#M868774</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;Could someone please explain me the Exists function in Qlikview and SQL.&lt;/P&gt;&lt;P&gt;I'm bit confused in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ashok.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exists-function-in-Qlikview-vs-SQL/m-p/1244033#M868774</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Exists function in Qlikview vs SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Exists-function-in-Qlikview-vs-SQL/m-p/1244034#M868775</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;Qlikview:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us assume we have tables like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose if you want to load the ID in Table2 which are in Table1 then use below script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FROM Table1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FROM Table2&lt;/P&gt;&lt;P&gt;WHERE Exists(ID); // It will load only 1, 3,5 and filter out 6 because it is not available in Table1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more example:&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you dont want to load duplicate rows then use below script&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;*&lt;/P&gt;&lt;P&gt;FROM Table1&lt;/P&gt;&lt;P&gt;WHERE NOT Exists(ID);&amp;nbsp; // It will load 1 and 5 only once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this type of scenarios we use Exists in qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The purpose of Exists() is same in both QV and SQL, the only difference is the way of using it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM Table1 AS s&amp;nbsp; &lt;/P&gt;&lt;P&gt;WHERE EXISTS&amp;nbsp; &lt;/P&gt;&lt;P&gt;(SELECT ID&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM Table2 b&lt;/P&gt;&lt;P&gt;&amp;nbsp; WHERE a.ID = b.ID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2016 05:42:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exists-function-in-Qlikview-vs-SQL/m-p/1244034#M868775</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2016-12-12T05:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Exists function in Qlikview vs SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Exists-function-in-Qlikview-vs-SQL/m-p/1244035#M868777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2016 04:40:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exists-function-in-Qlikview-vs-SQL/m-p/1244035#M868777</guid>
      <dc:creator />
      <dc:date>2016-12-13T04:40:03Z</dc:date>
    </item>
  </channel>
</rss>

