<?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: How to use Qlikview table in where filter in SQL query in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1575910#M741194</link>
    <description>if both sources are on the same database i would go like this;&lt;BR /&gt;&lt;BR /&gt;QV_UserAccess:&lt;BR /&gt;SQL&lt;BR /&gt;SELECT&lt;BR /&gt;DisplayName&lt;BR /&gt;FROM Tab2&lt;BR /&gt;WHERE QVAppID = 3&lt;BR /&gt;AND ActiveLogin = 1,&lt;BR /&gt;AND DisplayName NOT IN ( SELECT DISTINCT QV_EXEC_NAME AS "DisplayName" FROM Myview)&lt;BR /&gt;&lt;BR /&gt;if not i would do it like this:&lt;BR /&gt;Table1:&lt;BR /&gt;LOAD '(' &amp;amp; concat(DisplayName, ',') &amp;amp; ')' as DisplayName;&lt;BR /&gt;SQL&lt;BR /&gt;SELECT DISTINCT QV_EXEC_NAME AS "DisplayName" FROM Myview;&lt;BR /&gt;&lt;BR /&gt;LET vWhereStatement = peek('DisplayName', 0, 'Table1');&lt;BR /&gt;&lt;BR /&gt;drop table Table1;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;QV_UserAccess:&lt;BR /&gt;//get all live users for usage stats&lt;BR /&gt;SQL&lt;BR /&gt;SELECT&lt;BR /&gt;DisplayName&lt;BR /&gt;FROM Tab2&lt;BR /&gt;WHERE QVAppID = 3&lt;BR /&gt;AND ActiveLogin = 1,&lt;BR /&gt;AND DisplayName NOT IN '$(vWhereStatement)'&lt;BR /&gt;</description>
    <pubDate>Thu, 02 May 2019 13:24:57 GMT</pubDate>
    <dc:creator>zhadrakas</dc:creator>
    <dc:date>2019-05-02T13:24:57Z</dc:date>
    <item>
      <title>How to use Qlikview table in where filter in SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1575902#M741193</link>
      <description>&lt;P&gt;&lt;FONT color="#000000" face="georgia,palatino" size="4"&gt;Hi All&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="georgia,palatino" size="4"&gt;I have created table1 which is populating&amp;nbsp; data from Oracle source.I want to use it into in where condition in the SQL query to check the distinct DisplayName.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="georgia,palatino" size="4"&gt;How can I do this ? Please suggest ,below approach is giving me error message&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;FONT color="#800000"&gt;Table1:&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="1"&gt;LOAD&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="1"&gt; *;&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="1"&gt;SQL&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="1"&gt;&lt;BR /&gt;SELECT DISTINCT QV_EXEC_NAME AS &lt;/FONT&gt;&lt;FONT color="#800000" size="1"&gt;"DisplayName"&lt;/FONT&gt;&lt;FONT size="1"&gt; FROM&amp;nbsp;&amp;nbsp;Myview;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;QV_UserAccess:&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="1"&gt;LOAD&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="1"&gt; *;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#008000" size="1"&gt;//get all live users for usage stats&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="1"&gt;SQL&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="1"&gt;&lt;BR /&gt;SELECT &lt;/FONT&gt;&lt;FONT size="1"&gt;&lt;BR /&gt;DisplayName&lt;BR /&gt;FROM Tab2&lt;BR /&gt;WHERE QVAppID = 3&lt;BR /&gt;AND ActiveLogin = 1,&lt;BR /&gt;AND DisplayName NOT IN&amp;nbsp; ( Select DisplayName&amp;nbsp; from &lt;FONT color="#800000"&gt;Table1)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1575902#M741193</guid>
      <dc:creator>vijaysahu2</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Qlikview table in where filter in SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1575910#M741194</link>
      <description>if both sources are on the same database i would go like this;&lt;BR /&gt;&lt;BR /&gt;QV_UserAccess:&lt;BR /&gt;SQL&lt;BR /&gt;SELECT&lt;BR /&gt;DisplayName&lt;BR /&gt;FROM Tab2&lt;BR /&gt;WHERE QVAppID = 3&lt;BR /&gt;AND ActiveLogin = 1,&lt;BR /&gt;AND DisplayName NOT IN ( SELECT DISTINCT QV_EXEC_NAME AS "DisplayName" FROM Myview)&lt;BR /&gt;&lt;BR /&gt;if not i would do it like this:&lt;BR /&gt;Table1:&lt;BR /&gt;LOAD '(' &amp;amp; concat(DisplayName, ',') &amp;amp; ')' as DisplayName;&lt;BR /&gt;SQL&lt;BR /&gt;SELECT DISTINCT QV_EXEC_NAME AS "DisplayName" FROM Myview;&lt;BR /&gt;&lt;BR /&gt;LET vWhereStatement = peek('DisplayName', 0, 'Table1');&lt;BR /&gt;&lt;BR /&gt;drop table Table1;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;QV_UserAccess:&lt;BR /&gt;//get all live users for usage stats&lt;BR /&gt;SQL&lt;BR /&gt;SELECT&lt;BR /&gt;DisplayName&lt;BR /&gt;FROM Tab2&lt;BR /&gt;WHERE QVAppID = 3&lt;BR /&gt;AND ActiveLogin = 1,&lt;BR /&gt;AND DisplayName NOT IN '$(vWhereStatement)'&lt;BR /&gt;</description>
      <pubDate>Thu, 02 May 2019 13:24:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1575910#M741194</guid>
      <dc:creator>zhadrakas</dc:creator>
      <dc:date>2019-05-02T13:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Qlikview table in where filter in SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1575915#M741195</link>
      <description>&lt;P&gt;What i did in a similar case was something like that:&lt;/P&gt;&lt;P&gt;Accounts:&lt;BR /&gt;LOAD Distinct&lt;BR /&gt;NewAccount as ArrangementIdInSourceSystem&lt;BR /&gt;FROM&lt;BR /&gt;[D:\Accounts.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is NewAccount);&lt;/P&gt;&lt;P&gt;LET vNoOfRows=NoOfRows('Accounts');&lt;/P&gt;&lt;P&gt;FOR i=1 to $(vNoOfRows)&lt;BR /&gt;LET vTmp=FieldValue('ArrangementIdInSourceSystem',$(i));&lt;BR /&gt;IF $(i)= 1 THEN&lt;BR /&gt;SET vAcc= "'$(vTmp)'";&lt;BR /&gt;ELSE&lt;BR /&gt;SET vAcc=$(vAcc),'$(vTmp)';&lt;BR /&gt;ENDIF&lt;BR /&gt;NEXT;&lt;/P&gt;&lt;P&gt;DROP TABLE Accounts;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT&lt;BR /&gt;AR01T.UNQID,&lt;BR /&gt;AR01T.ARID&lt;BR /&gt;FROM&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AR01T AS AR01T&lt;BR /&gt;WHERE&lt;BR /&gt;AR01T.UNQID IN ($(vAcc))&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 13:31:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1575915#M741195</guid>
      <dc:creator>dapostolopoylos</dc:creator>
      <dc:date>2019-05-02T13:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Qlikview table in where filter in SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1576019#M741196</link>
      <description>Thanks I tried it but it is giving me incorrect syntax error</description>
      <pubDate>Thu, 02 May 2019 15:26:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1576019#M741196</guid>
      <dc:creator>vijaysahu2</dc:creator>
      <dc:date>2019-05-02T15:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Qlikview table in where filter in SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1576020#M741197</link>
      <description>Thanks I tried it but it is giving me incorrect syntax error</description>
      <pubDate>Thu, 02 May 2019 15:26:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1576020#M741197</guid>
      <dc:creator>vijaysahu2</dc:creator>
      <dc:date>2019-05-02T15:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Qlikview table in where filter in SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1576057#M741198</link>
      <description>&lt;P&gt;It worked and corrected syntax error issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AND DisplayName NOT IN ('$(vWhereStatement)');&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 17:34:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1576057#M741198</guid>
      <dc:creator>vijaysahu2</dc:creator>
      <dc:date>2019-05-02T17:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Qlikview table in where filter in SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1576059#M741199</link>
      <description>This also worked after correcting incorrect syntax issue&lt;BR /&gt;&lt;BR /&gt;AND DisplayName NOT IN ('($vAcc)');</description>
      <pubDate>Thu, 02 May 2019 17:35:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Qlikview-table-in-where-filter-in-SQL-query/m-p/1576059#M741199</guid>
      <dc:creator>vijaysahu2</dc:creator>
      <dc:date>2019-05-02T17:35:45Z</dc:date>
    </item>
  </channel>
</rss>

