<?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: do while loop syntax error in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/do-while-loop-syntax-error/m-p/1803460#M65222</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/47469"&gt;@Levi_Turner&lt;/a&gt;&amp;nbsp;, I figured it out already and did something very similar although yours looks very well put together, i will keep that in mind for future use &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Very helpful!&lt;/P&gt;&lt;P&gt;Refering to that setting, please have a look at my next thread on this , maybe you could help me&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/New-to-Qlik-Sense/store-qvd-script-routine-except-for-one-table/m-p/1803456#M184079" target="_blank"&gt;https://community.qlik.com/t5/New-to-Qlik-Sense/store-qvd-script-routine-except-for-one-table/m-p/1803456#M184079&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;This community rocks!&lt;/P&gt;</description>
    <pubDate>Wed, 28 Apr 2021 10:33:00 GMT</pubDate>
    <dc:creator>ioannagr</dc:creator>
    <dc:date>2021-04-28T10:33:00Z</dc:date>
    <item>
      <title>do while loop syntax error</title>
      <link>https://community.qlik.com/t5/App-Development/do-while-loop-syntax-error/m-p/1800897#M64906</link>
      <description>&lt;P&gt;Hello all.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table2 is very large so I'm asked to read every 100 lines&amp;nbsp; of&amp;nbsp; common ids and the relevant info and store these in&amp;nbsp; a new table because i don't have the ram and storage space to load all tables at once and do incremental loads.&lt;/P&gt;&lt;P&gt;I have come up with this so far, it is not working. Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table1_ids:&lt;BR /&gt;LOAD pk as table1_pk;&lt;BR /&gt;SQL SELECT pk&lt;BR /&gt;FROM public.Table1&lt;BR /&gt;ORDER BY `pk` asc;&lt;/P&gt;&lt;P&gt;MaxTab1Pk:&lt;BR /&gt;LOAD max(pk) as MaxTab1Pk,&lt;BR /&gt;min(pk) as MinTab1Pk;&lt;BR /&gt;SQL SELECT pk&lt;BR /&gt;FROM public.Table1;&lt;/P&gt;&lt;P&gt;Let MaxTab1Pk = Peek('MaxTab1Pk', 0 , MaxTab1Pk);&lt;BR /&gt;Let MinTab1Pk = Peek('MinTab1Pk', 0 , MinTab1Pk);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Set a=$(MinTab1Pk);&lt;BR /&gt;//tab2_ids&lt;BR /&gt;Do while a&amp;lt;= $(MaxTab1Pk)&lt;/P&gt;&lt;P&gt;LOAD pk as table2_pk,&lt;BR /&gt;table1_fk as table1_pk;&lt;BR /&gt;SQL select `pk`, `table1_fk` as table1_pk&lt;BR /&gt;from public.Table2&lt;BR /&gt;where public.Table2.`table1_pk`= public.Table1.`pk`;&lt;/P&gt;&lt;P&gt;Let a=a+1;&lt;/P&gt;&lt;P&gt;//store to a load inline table? a csv?&lt;BR /&gt;Loop&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 12:08:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/do-while-loop-syntax-error/m-p/1800897#M64906</guid>
      <dc:creator>ioannagr</dc:creator>
      <dc:date>2021-04-20T12:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: do while loop syntax error</title>
      <link>https://community.qlik.com/t5/App-Development/do-while-loop-syntax-error/m-p/1803322#M65195</link>
      <description>&lt;P&gt;If you can't do a full load into memory, then you'd want to store the table to disk in some format. From the Qlik side, QVDs are more optimized for loading back into Qlik, which means they are the ideal format. To mock up and example to PostgreSQL, this code is working on my end:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// Offload the min / max to the Database if possible; it'll save you a step
MinMaxTable:
LOAD 
    maxid,
    minid;
SQL SELECT 
    max(id) AS maxid,
    min(id) AS minid
FROM public.test;

LET MaxID = PEEK('maxid', 0 , MinMaxTable); // Store Maximum value
LET MinID = PEEK('minid', 0 , MinMaxTable); // Store Mininum value

DROP TABLE [MinMaxTable]; // Drop the helper table since it isn't needed in future loads

LET a=MinID; // Set A to the minimum. In my case, 1
LET b=a+99; // Set B to 100 more (inclusive) to A

DO WHILE a &amp;lt;= $(MaxID)
	// Load Records between A and B
	[table]:
    LOAD 
        id AS [id],
        t AS [text];
    SQL SELECT 
    	"id",
		"t"
	FROM "public"."test" WHERE "id" &amp;gt;= $(a) AND "id" &amp;lt;= $(b);
    STORE [table] INTO [lib://data/loopExample/table_$(a).qvd] (QVD); // Store the table to a QVD
    DROP TABLE [table]; // Drop the table. Without the STORE / DROP, the table will auto-concat which puts us back to the starting point of the table not fitting into memory
	LET a=a+100; // Increment A to the next 100. In run 1, A will become 101
    LET b=a+99; // Increment B to the next 100. In run 1, B will become 200
LOOP&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 23:14:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/do-while-loop-syntax-error/m-p/1803322#M65195</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2021-04-27T23:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: do while loop syntax error</title>
      <link>https://community.qlik.com/t5/App-Development/do-while-loop-syntax-error/m-p/1803460#M65222</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/47469"&gt;@Levi_Turner&lt;/a&gt;&amp;nbsp;, I figured it out already and did something very similar although yours looks very well put together, i will keep that in mind for future use &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Very helpful!&lt;/P&gt;&lt;P&gt;Refering to that setting, please have a look at my next thread on this , maybe you could help me&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/New-to-Qlik-Sense/store-qvd-script-routine-except-for-one-table/m-p/1803456#M184079" target="_blank"&gt;https://community.qlik.com/t5/New-to-Qlik-Sense/store-qvd-script-routine-except-for-one-table/m-p/1803456#M184079&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;This community rocks!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 10:33:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/do-while-loop-syntax-error/m-p/1803460#M65222</guid>
      <dc:creator>ioannagr</dc:creator>
      <dc:date>2021-04-28T10:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: do while loop syntax error</title>
      <link>https://community.qlik.com/t5/App-Development/do-while-loop-syntax-error/m-p/1803804#M65272</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/47469"&gt;@Levi_Turner&lt;/a&gt;&amp;nbsp; Hi, I run your script and it loads as you said but i saw it now, by 100 (1, 101,201 etc), while i wanted it to store batches of 100 ids each time, for example read id 1 to 100, then store, then go from 101 to 200 then store. How can I do this?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 12:11:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/do-while-loop-syntax-error/m-p/1803804#M65272</guid>
      <dc:creator>ioannagr</dc:creator>
      <dc:date>2021-04-29T12:11:47Z</dc:date>
    </item>
  </channel>
</rss>

