<?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: For Next issue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/For-Next-issue/m-p/1288943#M403301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I tried moving it to the next line but the script fails even though the red line disappears.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Mar 2017 02:55:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-03-28T02:55:28Z</dc:date>
    <item>
      <title>For Next issue</title>
      <link>https://community.qlik.com/t5/QlikView/For-Next-issue/m-p/1288941#M403299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to check that a table has a certain value in it (-1) before it continues with the load process.&amp;nbsp; If the table does not have the required value then the process loops and tries 3 more times.&amp;nbsp; The issue I have is the any function&amp;nbsp; does not work after the 'then' statement.&amp;nbsp; There is a red squiggle line below the text after the 'then' statement and the load fails (Script line error).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;for&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;i&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 3&lt;BR /&gt; Load_temp:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;load&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Active &lt;SPAN style="color: #339966;"&gt;//field name that should contain at least one -1 value&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; SELECT Active&lt;BR /&gt; FROM [PJB_ED].dbo.[tbl_PJB_ED_Data]&lt;BR /&gt; Where ArrivalDate &amp;gt; DATEADD(dd, DATEDIFF(dd, +2, getdate()), 0)&lt;BR /&gt; and Active = -1&lt;BR /&gt; and left(RoomBed,4) &amp;lt;&amp;gt; 'XRay'&lt;BR /&gt; ;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoOfRows&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;SPAN style="font-size: 8pt;"&gt;'Load_temp'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;&amp;gt; 0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; exit for; &lt;SPAN style="color: #339966;"&gt;// This line is where the problem is - after then 'then' statement anything gets red squiggle line&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;sleep 5000; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// 5 seconds &lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;next&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; i&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt; ;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 22:23:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Next-issue/m-p/1288941#M403299</guid>
      <dc:creator />
      <dc:date>2017-03-27T22:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: For Next issue</title>
      <link>https://community.qlik.com/t5/QlikView/For-Next-issue/m-p/1288942#M403300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Moving the script to the next line seems to resolve the issue... Not sure why we need to move it to next lime, but you can see in the image that it works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/157810_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 02:25:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Next-issue/m-p/1288942#M403300</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-28T02:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: For Next issue</title>
      <link>https://community.qlik.com/t5/QlikView/For-Next-issue/m-p/1288943#M403301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I tried moving it to the next line but the script fails even though the red line disappears.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 02:55:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Next-issue/m-p/1288943#M403301</guid>
      <dc:creator />
      <dc:date>2017-03-28T02:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: For Next issue</title>
      <link>https://community.qlik.com/t5/QlikView/For-Next-issue/m-p/1288944#M403302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have solved the problem. Adding an endif helped fix it. The exit for has to be on the next line (as you identified) but the endif is also required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for responding and helping me solve the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the corrected part of the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoOfRows&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;vRows&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;&amp;gt; 0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;exit&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;endif &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 03:22:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Next-issue/m-p/1288944#M403302</guid>
      <dc:creator />
      <dc:date>2017-03-28T03:22:41Z</dc:date>
    </item>
  </channel>
</rss>

