<?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: Incremental Load - Exit Script not working when Loop field after in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Incremental-Load-Exit-Script-not-working-when-Loop-field-after/m-p/1699602#M591954</link>
    <description>&lt;P&gt;You might try it like this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Let vExit = if($(vRows)=0 , 'Exit Script;', '');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$(vExit)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;</description>
    <pubDate>Wed, 06 May 2020 21:27:09 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2020-05-06T21:27:09Z</dc:date>
    <item>
      <title>Incremental Load - Exit Script not working when Loop field after</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-Load-Exit-Script-not-working-when-Loop-field-after/m-p/1699585#M591953</link>
      <description>&lt;P&gt;Hi Qlik Community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on building an incremental loader, but I'm having trouble with the logic needed when there is no data.&lt;/P&gt;&lt;P&gt;To pull in the data I built a loop that pulls in each new id and cycles them through the&amp;nbsp; REST connection statement using a loop. The issue I'm having is when there is no new data, I want the script to exit, but because there is a loop statement in the script, it errors with the "&amp;nbsp;Semantic error The control statement is not correctly matched with its corresponding start statement Loop" despite the exit script. See an excerpt of my script below.&lt;/P&gt;&lt;P&gt;Is there a workaround for this? I can't put an &lt;EM&gt;If&lt;/EM&gt; around the whole thing because I'm using &lt;EM&gt;If/end if&lt;/EM&gt; in the loop. Additionally, I've tested the exit script logic and it will exit successfully if the loop statement is not present.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Source:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;load&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;id, &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;RowNo() as RowNo&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;SourceTable&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(qvd)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Where &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;not Exists(key,id) and&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;not isnull(id)&lt;/EM&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;let vRows=if(isnull(Peek('RowNo',-1,'Source')),0,Peek('RowNo',-1,'Source'));&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Exit script when $(vRows)=0&amp;nbsp; &amp;nbsp;//Exit script here if there are no new records&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;Set i=0;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Do while i&amp;lt;$(vRows)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Rest connection logic to pull in all tables..................................&lt;/P&gt;&lt;P&gt;&lt;EM&gt;let i=i+1;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Loop;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help! Please let me know if I can provide any additional info!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:43:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-Load-Exit-Script-not-working-when-Loop-field-after/m-p/1699585#M591953</guid>
      <dc:creator>etrotter</dc:creator>
      <dc:date>2024-11-16T00:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental Load - Exit Script not working when Loop field after</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-Load-Exit-Script-not-working-when-Loop-field-after/m-p/1699602#M591954</link>
      <description>&lt;P&gt;You might try it like this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Let vExit = if($(vRows)=0 , 'Exit Script;', '');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$(vExit)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 21:27:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-Load-Exit-Script-not-working-when-Loop-field-after/m-p/1699602#M591954</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2020-05-06T21:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental Load - Exit Script not working when Loop field after</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-Load-Exit-Script-not-working-when-Loop-field-after/m-p/1699877#M591955</link>
      <description>&lt;P&gt;Thanks Rob!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, that solution didn't work, but I used that logic for the "loop" function, and it worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Let vLoop = if($(vRows)=0 , '', 'Loop');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$(vLoop)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 14:55:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-Load-Exit-Script-not-working-when-Loop-field-after/m-p/1699877#M591955</guid>
      <dc:creator>etrotter</dc:creator>
      <dc:date>2020-05-07T14:55:51Z</dc:date>
    </item>
  </channel>
</rss>

