<?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: Use of exists in the SQL in statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674159#M244786</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *;&lt;/P&gt;&lt;P&gt;Sql Select * from YourTable where Field1='Yourfilter';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Sep 2014 07:09:41 GMT</pubDate>
    <dc:creator>AbhijitBansode</dc:creator>
    <dc:date>2014-09-11T07:09:41Z</dc:date>
    <item>
      <title>Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674154#M244781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have field called f_Acct which contains around 1000 values before loading the FACT table from a database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;where exists(f_Acct,ACCT);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SQL Select Column1,&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; Column2,&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; ACCT&lt;/P&gt;&lt;P&gt;From Account_Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using the exists in the Qlikview load statement I want make use of the same in the SQL Statement. As the SQL load all the data from the Account_Table and then we filters the values in the Preceding load using exists which having performance issue. Please help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 06:54:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674154#M244781</guid>
      <dc:creator>qlikviewforum</dc:creator>
      <dc:date>2014-09-11T06:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674155#M244782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like:&lt;/P&gt;&lt;P&gt;Load * ;&lt;/P&gt;&lt;P&gt;SQL Select &lt;STRONG&gt;Distinct&lt;/STRONG&gt; Column1,&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; Column2,&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; ACCT&lt;/P&gt;&lt;P&gt;From Account_Table;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 06:59:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674155#M244782</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-09-11T06:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674156#M244783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you create a QVD for Account_Table and then use it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Singh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 07:01:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674156#M244783</guid>
      <dc:creator />
      <dc:date>2014-09-11T07:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674157#M244784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;write the sql Select statement in the same syntax which you use on database.&lt;/P&gt;&lt;P&gt;SQL Select statements will be excuted by database engine not by QlkView.&lt;/P&gt;&lt;P&gt;SQL Select statements are send to the database by QlikView for excution and result s returned in hte QlikView.&lt;/P&gt;&lt;P&gt;Hence all the SQL syntax would work in QlikView SQL&amp;nbsp; Statements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 07:03:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674157#M244784</guid>
      <dc:creator>AbhijitBansode</dc:creator>
      <dc:date>2014-09-11T07:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674158#M244785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This may not improve the performance as I have huge no of records which is coming from SQL. So I want to make use of where clause in the SQL statement instead of QV load statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 07:04:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674158#M244785</guid>
      <dc:creator>qlikviewforum</dc:creator>
      <dc:date>2014-09-11T07:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674159#M244786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *;&lt;/P&gt;&lt;P&gt;Sql Select * from YourTable where Field1='Yourfilter';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 07:09:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674159#M244786</guid>
      <dc:creator>AbhijitBansode</dc:creator>
      <dc:date>2014-09-11T07:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674160#M244787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have advised to use distinct in SQL Select part, that means it gets executed in the source database and NOT in QV.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 07:13:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674160#M244787</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-09-11T07:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674161#M244788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can make a coma separated list variable of the ID's in f_Acct using concat functions and then pass it in SQL statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *;&lt;/P&gt;&lt;P&gt;Sql Select * from YourTable where Field1 in ($(vList));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 07:13:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674161#M244788</guid>
      <dc:creator />
      <dc:date>2014-09-11T07:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674162#M244789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi tresesco, your answer is 100% correct, I didn't mean to contradict your answer, I thought its better to give explanation of what you've specified.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 07:21:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674162#M244789</guid>
      <dc:creator>AbhijitBansode</dc:creator>
      <dc:date>2014-09-11T07:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674163#M244790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I tried doing that but as the string is too long in the ($(vList)) variable, oracle is throwing the error("string literal too long"). I think I need to split the string into half then try doing it into using two IN clause in the SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on how to achieve this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 13:44:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674163#M244790</guid>
      <dc:creator>qlikviewforum</dc:creator>
      <dc:date>2014-09-11T13:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674164#M244791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I pass the variable in the SQL without single quotes&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;($(vList))&lt;/SPAN&gt; then it is not fetching any records. If I pass the single quotes &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;('$(vList)')&lt;/SPAN&gt; then it is throwing error. Can you please help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 13:58:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674164#M244791</guid>
      <dc:creator>qlikviewforum</dc:creator>
      <dc:date>2014-09-11T13:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674165#M244792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Error("string literal too long" means your string is more than 4000 chars. &lt;/SPAN&gt;It seems all the accounts are clubbed into one string. Check the value of &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;$(vList)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 14:05:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674165#M244792</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-09-11T14:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674166#M244793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It contains all the values with comma seperated. This is what should be passed into the SQL IN clause right?&lt;/P&gt;&lt;P&gt;vList='xyz','trt','rte','ete'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way should I pass single quotes while passing the variable in the SQL or not?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 14:09:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674166#M244793</guid>
      <dc:creator>qlikviewforum</dc:creator>
      <dc:date>2014-09-11T14:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674167#M244794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 14:10:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674167#M244794</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-09-11T14:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674168#M244795</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;You can try using exists() function instead of IN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *;&lt;/P&gt;&lt;P&gt;Sq&lt;/P&gt;&lt;P&gt;select f_Acct_orig&amp;nbsp; from&lt;/P&gt;&lt;P&gt;YourTable i1&lt;/P&gt;&lt;P&gt;join&lt;/P&gt;&lt;P&gt;(select 408007421 as f_Acct union all&lt;/P&gt;&lt;P&gt;select 407039314 union all&lt;/P&gt;&lt;P&gt;select 409691748 union all&lt;/P&gt;&lt;P&gt;select 407741572 union all&lt;/P&gt;&lt;P&gt;select 605662536 union all&lt;/P&gt;&lt;P&gt;select 407773540&amp;nbsp; union all&lt;/P&gt;&lt;P&gt;select 407759193) i2 on i1.f_Acct_orig = i2.f_Acct&lt;/P&gt;&lt;P&gt;l&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to do this is as above. Transform your id's into select .... union all format...and then keep the variable with that value..and use like above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Angad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 14:12:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674168#M244795</guid>
      <dc:creator />
      <dc:date>2014-09-11T14:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674169#M244796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I pass single quotes I am getting the below error. Please suggest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;"string literal too long"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 14:13:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674169#M244796</guid>
      <dc:creator>qlikviewforum</dc:creator>
      <dc:date>2014-09-11T14:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exists in the SQL in statement</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674170#M244797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try with few accounts say less than 10 in vList and check if you get the result. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 14:24:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-exists-in-the-SQL-in-statement/m-p/674170#M244797</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-09-11T14:24:31Z</dc:date>
    </item>
  </channel>
</rss>

