<?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 combine record from resident table into SQL where clause to another DB in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-combine-record-from-resident-table-into-SQL-where-clause/m-p/2012140#M83675</link>
    <description>&lt;P&gt;Thanks, I think that the "concat" solution is the best for my case. But how to sorround the product code with " ' " ex: '12345','98765'? thanks&lt;/P&gt;</description>
    <pubDate>Fri, 02 Dec 2022 14:09:55 GMT</pubDate>
    <dc:creator>Roberto03</dc:creator>
    <dc:date>2022-12-02T14:09:55Z</dc:date>
    <item>
      <title>How to combine record from resident table into SQL where clause to another DB</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-combine-record-from-resident-table-into-SQL-where-clause/m-p/2012037#M83672</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;in a table I have a list of products.&lt;/P&gt;
&lt;P&gt;PRODUCT:&lt;BR /&gt;LOAD DISTINCT AUG_COD_IMP&lt;BR /&gt;RESIDENT QLIK_PRODUCT_TABLE;&lt;/P&gt;
&lt;P&gt;I should use these product codes to filter an extractions towards an oracle DB.&lt;/P&gt;
&lt;P&gt;However, by inserting the records as a join or in the where clause, the system looks for the qlik table in the oracle db and then returns the error as "table not found".&lt;/P&gt;
&lt;P&gt;LIB CONNECT TO 'DB_ORDER';&lt;/P&gt;
&lt;P&gt;ORDERS:&lt;BR /&gt;SELECT &lt;BR /&gt;AUG_COD_IMP,&lt;BR /&gt;HTM_DATA_CAMPIONAMENTO,&lt;BR /&gt;FROM TELEMISURA  inner join &lt;STRONG&gt;PRODUCT&lt;/STRONG&gt; l on (l.AUG_COD_IMP = AUG_COD_IMP)&lt;BR /&gt;WHERE 1=1&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;How can I insert the record from qlik table into the sql query in order to avoid the extraction of the whole db?&lt;/P&gt;
&lt;P&gt;THANKS&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 11:21:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-combine-record-from-resident-table-into-SQL-where-clause/m-p/2012037#M83672</guid>
      <dc:creator>Roberto03</dc:creator>
      <dc:date>2022-12-02T11:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine record from resident table into SQL where clause to another DB</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-combine-record-from-resident-table-into-SQL-where-clause/m-p/2012046#M83673</link>
      <description>&lt;P&gt;If the amount of data isn't too big (depends on the database + network performance and the accepted run-times) you could apply the filter on a preceding load, like:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ORDERS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;load * where exists(AUG_COD_IMP);&lt;BR /&gt;SQL SELECT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AUG_COD_IMP,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;HTM_DATA_CAMPIONAMENTO,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM TELEMISURA;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;which means that all records are pulled from the database at first and afterwards filtered. Another way could be to concatenate all values into a string and using this within an IN(), for example like:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PRODUCT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOAD DISTINCT concat(AUG_COD_IMP, ',') as AUG_COD_IMP&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RESIDENT QLIK_PRODUCT_TABLE;&lt;/SPAN&gt; &lt;/P&gt;
&lt;P&gt;let var = fieldvalue('&lt;SPAN&gt;AUG_COD_IMP', 1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SQL SELECT&lt;BR /&gt;AUG_COD_IMP,&lt;BR /&gt;HTM_DATA_CAMPIONAMENTO,&lt;BR /&gt;FROM TELEMISURA where AUG_COD_IMP in ($(var));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Depending on the kind of content the string-creation needs to include a quotation of the values. AFAIK the most databases have a limit how many values an IN() could contain.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If both methods are not practicably you could store the Qlik table as csv and importing them as a temporary table within the database and then the data are there natively available.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- Marcus&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 11:51:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-combine-record-from-resident-table-into-SQL-where-clause/m-p/2012046#M83673</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-12-02T11:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine record from resident table into SQL where clause to another DB</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-combine-record-from-resident-table-into-SQL-where-clause/m-p/2012140#M83675</link>
      <description>&lt;P&gt;Thanks, I think that the "concat" solution is the best for my case. But how to sorround the product code with " ' " ex: '12345','98765'? thanks&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 14:09:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-combine-record-from-resident-table-into-SQL-where-clause/m-p/2012140#M83675</guid>
      <dc:creator>Roberto03</dc:creator>
      <dc:date>2022-12-02T14:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine record from resident table into SQL where clause to another DB</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-combine-record-from-resident-table-into-SQL-where-clause/m-p/2012178#M83679</link>
      <description>&lt;P&gt;You could try it in this way:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PRODUCT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOAD DISTINCT concat(&lt;STRONG&gt;chr(39) &amp;amp;&lt;/STRONG&gt; AUG_COD_IMP &lt;STRONG&gt;&amp;amp; chr(39)&lt;/STRONG&gt;, ',') as AUG_COD_IMP&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RESIDENT QLIK_PRODUCT_TABLE;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 15:31:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-combine-record-from-resident-table-into-SQL-where-clause/m-p/2012178#M83679</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-12-02T15:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine record from resident table into SQL where clause to another DB</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-combine-record-from-resident-table-into-SQL-where-clause/m-p/2012182#M83680</link>
      <description>&lt;P&gt;perfect! thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 15:42:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-combine-record-from-resident-table-into-SQL-where-clause/m-p/2012182#M83680</guid>
      <dc:creator>Roberto03</dc:creator>
      <dc:date>2022-12-02T15:42:20Z</dc:date>
    </item>
  </channel>
</rss>

