<?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 clause filter data with previous table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773095#M274310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the only thing is load all data from teradata, (during night?) and store them in a qvd file. Then load all data in your document from the qvd and finally reload them with exists, the advantage is that you load all data in a different moment from the loading of the document&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Jan 2015 14:05:55 GMT</pubDate>
    <dc:creator>alexandros17</dc:creator>
    <dc:date>2015-01-27T14:05:55Z</dc:date>
    <item>
      <title>Where clause filter data with previous table</title>
      <link>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773091#M274306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a excel file with 10 Product_Sub_group_ code&lt;/P&gt;&lt;P&gt;and Teradata table with Millions of rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done script like below but give me an error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tbl1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Product_Sub_Group_Code&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;D&gt;&lt;BR /&gt; (&lt;/D&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ooxml&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;embedded&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;labels&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; import);&lt;BR /&gt; &lt;BR /&gt; Tbl2: &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; SELECT *&lt;BR /&gt; FROM BUYER_LOOKUP&lt;BR /&gt; WHERE exists (Tbl1.Product_Sub_Group_Code)&lt;BR /&gt; &lt;BR /&gt; drop table Tbl1;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;error:---&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;SQL##f - SqlState: 37000, ErrorCode: 4294963590, ErrorMsg: [Teradata][ODBC Teradata Driver][Teradata Database] Syntax error: expected something between '(' and the word 'Tbl1'. &lt;BR /&gt;Tbl2: &lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM BUYER_LOOKUP&lt;BR /&gt;WHERE exists (Tbl1.Product_Sub_Group_Code)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG style="font-size: 14pt;"&gt;Note: I do not want Full Teradata table to be load. Can we use where clause to filter data using Tbl1? &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 13:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773091#M274306</guid>
      <dc:creator />
      <dc:date>2015-01-27T13:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Where clause filter data with previous table</title>
      <link>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773092#M274307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the clause Exists can be used with qlik syntax not sql. So you should have to load all the table in teradata then reload it with the exists condition but in this case you have to load all data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another solution is (but I do not know is syntax is correct) is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;BR /&gt;FROM BUYER_LOOKUP&lt;BR /&gt;WHERE Tbl1.Product_Sub_Group_Code in ('Code1','Code2','Code3', ....,'Code10')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where codes 1..10 are codes you have in your Excel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 13:05:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773092#M274307</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2015-01-27T13:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Where clause filter data with previous table</title>
      <link>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773093#M274308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;don't think in this way because not exists is a QlikView syntax and it only works in the Load section (but in the load section you're not in Teradata)&lt;/P&gt;&lt;P&gt;Maybe you can use a variable to&amp;nbsp; identify the Product_Sub_Group_Code to filter&lt;/P&gt;&lt;P&gt;and then use the variable in the second statement (SQL), pseudocode &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;&lt;/P&gt;&lt;P&gt;set &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10.9090909957886px;"&gt;variablewithproductsubgroupcode = ......;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sql select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10.9090909957886px;"&gt;WHERE fieldinteradata in ('$()variablewithproductsubgroupcode')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 13:15:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773093#M274308</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-01-27T13:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Where clause filter data with previous table</title>
      <link>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773094#M274309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Saccone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will use IN clause but It was just example of 10 rows but accualy there are Hundred of Code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we can do for all Codes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &amp;amp; Thanks&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 13:53:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773094#M274309</guid>
      <dc:creator />
      <dc:date>2015-01-27T13:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Where clause filter data with previous table</title>
      <link>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773095#M274310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the only thing is load all data from teradata, (during night?) and store them in a qvd file. Then load all data in your document from the qvd and finally reload them with exists, the advantage is that you load all data in a different moment from the loading of the document&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 14:05:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773095#M274310</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2015-01-27T14:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Where clause filter data with previous table</title>
      <link>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773096#M274311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;try something like this (load inline is a replacement of your load from excel)&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14223851501676027" jivemacro_uid="_14223851501676027" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;TB1:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;load * inline [&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Product_Sub_Group_Code&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;aaaa&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;bbbbb&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;cccccccc&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;ddddd&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;aaa bbb&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;e&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;f&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;e&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;f&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;g&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;B:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;load&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; '(' &amp;amp; chr(39) &amp;amp; concat(distinct Product_Sub_Group_Code, chr(39) &amp;amp; ',' &amp;amp; chr(39)) &amp;amp; chr(39) &amp;amp; ')' as SqlFilter&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Resident&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; TB1;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;LET v = Peek('SqlFilter');&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Tbl2: &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;SQL SELECT *&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;FROM BUYER_LOOKUP&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;WHERE Product_Sub_Group&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; line-height: 12pt;"&gt;_Code in $(v);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;EM style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;the query you send to db is&lt;/SPAN&gt;&lt;EM style="font-size: 8pt;"&gt; &lt;/EM&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14223851657028048" jivemacro_uid="_14223851657028048"&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;SELECT *&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;FROM BUYER_LOOKUP&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;WHERE Product_Sub_Group_Code in ('aaa bbb','aaaa','bbbbb','cccccccc','ddddd','e','f','g')&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 19:01:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Where-clause-filter-data-with-previous-table/m-p/773096#M274311</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-01-27T19:01:06Z</dc:date>
    </item>
  </channel>
</rss>

