<?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 List within a variable to use in SQL select in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/List-within-a-variable-to-use-in-SQL-select/m-p/1860094#M9858</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I have a list of customer numbers I write to a list and then store it in a variable, ie&lt;/P&gt;
&lt;P&gt;vList = 12345, 875895, 98371.... (less than 1000 customer numbers in the list).&lt;/P&gt;
&lt;P&gt;I then try to use the variable in a SQL script in the loader, something like:&lt;/P&gt;
&lt;P&gt;SQL Select * from Table where Customer_Num in ($(vList));&lt;/P&gt;
&lt;P&gt;But I get the following error:&amp;nbsp;Syntax error: expected something between '(' and ')'.&lt;/P&gt;
&lt;P&gt;If I type the Customer numbers into the SQL in the following format manually, i.e. '12345, 875895, 98371' - - it works. But when I try doing it in the variable, it doesnt work and gives above error.&lt;/P&gt;
&lt;P&gt;I also tried&amp;nbsp; char(39) &amp;amp; vList &amp;amp; char(39)... no luck&lt;/P&gt;
&lt;P&gt;Any advice?&lt;/P&gt;</description>
    <pubDate>Tue, 16 Nov 2021 20:19:50 GMT</pubDate>
    <dc:creator>DirkCtz</dc:creator>
    <dc:date>2021-11-16T20:19:50Z</dc:date>
    <item>
      <title>List within a variable to use in SQL select</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/List-within-a-variable-to-use-in-SQL-select/m-p/1860094#M9858</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I have a list of customer numbers I write to a list and then store it in a variable, ie&lt;/P&gt;
&lt;P&gt;vList = 12345, 875895, 98371.... (less than 1000 customer numbers in the list).&lt;/P&gt;
&lt;P&gt;I then try to use the variable in a SQL script in the loader, something like:&lt;/P&gt;
&lt;P&gt;SQL Select * from Table where Customer_Num in ($(vList));&lt;/P&gt;
&lt;P&gt;But I get the following error:&amp;nbsp;Syntax error: expected something between '(' and ')'.&lt;/P&gt;
&lt;P&gt;If I type the Customer numbers into the SQL in the following format manually, i.e. '12345, 875895, 98371' - - it works. But when I try doing it in the variable, it doesnt work and gives above error.&lt;/P&gt;
&lt;P&gt;I also tried&amp;nbsp; char(39) &amp;amp; vList &amp;amp; char(39)... no luck&lt;/P&gt;
&lt;P&gt;Any advice?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 20:19:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/List-within-a-variable-to-use-in-SQL-select/m-p/1860094#M9858</guid>
      <dc:creator>DirkCtz</dc:creator>
      <dc:date>2021-11-16T20:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: List within a variable to use in SQL select</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/List-within-a-variable-to-use-in-SQL-select/m-p/1860124#M9859</link>
      <description>&lt;P&gt;&lt;STRONG&gt;SET&lt;/STRONG&gt; vList = 12345, 875895, 98371 ;&lt;/P&gt;
&lt;P&gt;// try this&lt;/P&gt;
&lt;P&gt;SQL Select * from Table where Customer_Num in ('$(vList)');&lt;/P&gt;
&lt;P&gt;// or this&lt;BR /&gt;SQL Select * from Table where Customer_Num in ($(vList));&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 22:00:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/List-within-a-variable-to-use-in-SQL-select/m-p/1860124#M9859</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2021-11-16T22:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: List within a variable to use in SQL select</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/List-within-a-variable-to-use-in-SQL-select/m-p/1860675#M9863</link>
      <description>Thank you..&lt;BR /&gt;&lt;BR /&gt;Unfortunately neither of these options work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;The within the variable I store a concatenated list. If I type in the&lt;BR /&gt;customer numbers in the variable it does work, but if i assign the&lt;BR /&gt;concatenated list to the variable it doesn’t work.&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Nov 2021 21:50:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/List-within-a-variable-to-use-in-SQL-select/m-p/1860675#M9863</guid>
      <dc:creator>DirkCtz</dc:creator>
      <dc:date>2021-11-17T21:50:13Z</dc:date>
    </item>
  </channel>
</rss>

