<?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 WHERE Clauses in SQL Queries in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/WHERE-Clauses-in-SQL-Queries/m-p/1935385#M77063</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I'm wondering if there is a way to make a load script using a SQL query with dynamic update of the where clause ?&lt;/P&gt;
&lt;P&gt;Example :&lt;/P&gt;
&lt;P&gt;Id_Customers:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;Id_Customers&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;FileA;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SQL SELECT&lt;/P&gt;
&lt;P&gt;Customer_Id, Customer_name&lt;/P&gt;
&lt;P&gt;FROM customers&lt;/P&gt;
&lt;P&gt;Where customers.Customers_Id = (or in) Id_Customers (this data come from the file load above);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 May 2022 11:47:48 GMT</pubDate>
    <dc:creator>larouge69</dc:creator>
    <dc:date>2022-05-25T11:47:48Z</dc:date>
    <item>
      <title>WHERE Clauses in SQL Queries</title>
      <link>https://community.qlik.com/t5/App-Development/WHERE-Clauses-in-SQL-Queries/m-p/1935385#M77063</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I'm wondering if there is a way to make a load script using a SQL query with dynamic update of the where clause ?&lt;/P&gt;
&lt;P&gt;Example :&lt;/P&gt;
&lt;P&gt;Id_Customers:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;Id_Customers&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;FileA;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SQL SELECT&lt;/P&gt;
&lt;P&gt;Customer_Id, Customer_name&lt;/P&gt;
&lt;P&gt;FROM customers&lt;/P&gt;
&lt;P&gt;Where customers.Customers_Id = (or in) Id_Customers (this data come from the file load above);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 11:47:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/WHERE-Clauses-in-SQL-Queries/m-p/1935385#M77063</guid>
      <dc:creator>larouge69</dc:creator>
      <dc:date>2022-05-25T11:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Clauses in SQL Queries</title>
      <link>https://community.qlik.com/t5/App-Development/WHERE-Clauses-in-SQL-Queries/m-p/1935409#M77066</link>
      <description>&lt;P&gt;Try with a variable&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Id_Customers:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Id_Customers&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;TMP2: &lt;BR /&gt;&lt;STRONG&gt;LOAD CONCAT(Id_Customers, ', ') as Field2 RESIDENT Id_Customers;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;LET vField2= PEEK('Field2', 0, 'TMP2');&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;// vField2 = 1, 2, 3&lt;/P&gt;
&lt;P&gt;SQL SELECT Customer_Id, Customer_name&lt;BR /&gt;FROM customers&lt;BR /&gt;Where customers.Customers_Id IN&lt;STRONG&gt; ($(vField2))&lt;/STRONG&gt;&lt;BR /&gt;;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 12:18:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/WHERE-Clauses-in-SQL-Queries/m-p/1935409#M77066</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2022-05-25T12:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Clauses in SQL Queries</title>
      <link>https://community.qlik.com/t5/App-Development/WHERE-Clauses-in-SQL-Queries/m-p/1935517#M77078</link>
      <description>&lt;P&gt;Alternatively you can use EXISTS()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example :&lt;/P&gt;
&lt;P&gt;Id_Customers:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;Id_Customers&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;FileA;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TableB:&lt;/P&gt;
&lt;P&gt;Load *&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where Exists(Id_Customers,&lt;SPAN&gt;Customers_Id&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P&gt;SQL SELECT&lt;/P&gt;
&lt;P&gt;Customer_Id, Customer_name&lt;/P&gt;
&lt;P&gt;FROM customers;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 13:43:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/WHERE-Clauses-in-SQL-Queries/m-p/1935517#M77078</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2022-05-25T13:43:37Z</dc:date>
    </item>
  </channel>
</rss>

