<?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: Select the first rows for SQL Query in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Select-the-first-rows-for-SQL-Query/m-p/2066661#M87510</link>
    <description>&lt;P&gt;Unfortunately, I tried your solution but it does not work...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;VContainerList is still empty...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 11:12:48 GMT</pubDate>
    <dc:creator>pietapa</dc:creator>
    <dc:date>2023-05-02T11:12:48Z</dc:date>
    <item>
      <title>Select the first rows for SQL Query</title>
      <link>https://community.qlik.com/t5/App-Development/Select-the-first-rows-for-SQL-Query/m-p/2066606#M87504</link>
      <description>&lt;P&gt;Hello guys,&lt;BR /&gt;I have a large list of containers that I need to use for my SQL query. However, I keep encountering an error when I try to run the SQL query with the entire list. The error message usually states that a column cannot be found or there are issues with the connection.&lt;/P&gt;
&lt;P&gt;To work around this problem, I am looking to retrieve a subset of the containers and use that for my SQL query instead. Specifically, I would like to retrieve the first five or more rows of containers and store them in an array.&lt;/P&gt;
&lt;P&gt;However, I am unsure of how to retrieve a subset of rows from the container list. Could you please provide guidance on how I can achieve this?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pietapa_0-1683018974296.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/106230i8E9E80FF8F7543D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pietapa_0-1683018974296.png" alt="pietapa_0-1683018974296.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 09:31:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Select-the-first-rows-for-SQL-Query/m-p/2066606#M87504</guid>
      <dc:creator>pietapa</dc:creator>
      <dc:date>2023-05-02T09:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select the first rows for SQL Query</title>
      <link>https://community.qlik.com/t5/App-Development/Select-the-first-rows-for-SQL-Query/m-p/2066628#M87506</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/196380"&gt;@pietapa&lt;/a&gt;&amp;nbsp; assuming you have container list stored somewhere which you can use. I have used first 5 in load to load first 5 values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;containers:
LOAD concat(chr(39) &amp;amp; container &amp;amp; chr(39) ,',') as list_container;
first 5 LOAD distinct container
FROM Source;

let vContainerList = peek('list_container',0,'containers');

drop table containers;

then, you can pass the list to SQL query like below

query:
SQL select *
FROM TableName
where container in ('$(vContainerList)');&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 11:23:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Select-the-first-rows-for-SQL-Query/m-p/2066628#M87506</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2023-05-02T11:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Select the first rows for SQL Query</title>
      <link>https://community.qlik.com/t5/App-Development/Select-the-first-rows-for-SQL-Query/m-p/2066661#M87510</link>
      <description>&lt;P&gt;Unfortunately, I tried your solution but it does not work...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;VContainerList is still empty...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 11:12:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Select-the-first-rows-for-SQL-Query/m-p/2066661#M87510</guid>
      <dc:creator>pietapa</dc:creator>
      <dc:date>2023-05-02T11:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select the first rows for SQL Query</title>
      <link>https://community.qlik.com/t5/App-Development/Select-the-first-rows-for-SQL-Query/m-p/2066672#M87511</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/196380"&gt;@pietapa&lt;/a&gt;&amp;nbsp; Not sure how you are doing it but if you follow same steps it should not generate NULL&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 11:25:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Select-the-first-rows-for-SQL-Query/m-p/2066672#M87511</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2023-05-02T11:25:04Z</dc:date>
    </item>
  </channel>
</rss>

