<?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: Exit for when condition is met in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Exit-for-when-condition-is-met/m-p/1411428#M514545</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason for your exit for is not working because "nr_liq" is a Field and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the condition EXIT FOR when Len(nr_liq)&amp;gt;0 will not see the field nr_liq as it is not accessable out side the load statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to use Peek function to get a record value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;&lt;P&gt;Sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 20 Aug 2017 18:35:42 GMT</pubDate>
    <dc:creator>sasiparupudi1</dc:creator>
    <dc:date>2017-08-20T18:35:42Z</dc:date>
    <item>
      <title>Exit for when condition is met</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-for-when-condition-is-met/m-p/1411426#M514543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm loading n xml files into QV and searching for a string (which is in an auxiliary table) in a field from these xml.&lt;/P&gt;&lt;P&gt;The problem is that I need to stop searching for the string when I first find it, which would be something like 'exit for', and jump to the next file. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried&amp;nbsp; EXIT FOR when Len(nr_liq)&amp;gt;0 but no luck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET NumRows=NoOfRows('Criteria');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR each FILE in filelist (Root&amp;amp;'\*.xml')&lt;/P&gt;&lt;P&gt;FOR i=0 to $(NumRows)-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vTexto=Peek('TEXTO',$(i),'Criteria');&lt;/P&gt;&lt;P&gt;LET vCaract=Peek('CARACT',$(i),'Criteria');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xml:&lt;/P&gt;&lt;P&gt;//NFe_mod1:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; Trim(Replace(Mid([NFe/infNFe/infAdic/infCpl],Index([NFe/infNFe/infAdic/infCpl],'$(vTexto)'),$(vCaract)),'$(vTexto)','')) as nr_liq,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Num(replace([NFe/infNFe/total/ICMSTot/vNF],'.',','),'#.##0,##') as vlr_xml0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; [NFe/infNFe/emit/CNPJ] as CNPJ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FileName([FILE]) as nome_arquivo &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM [$(FILE)](XmlSimple, Table is [nfeProc])&lt;/P&gt;&lt;P&gt;WHERE Index([NFe/infNFe/infAdic/infCpl],'$(vTexto)')&amp;lt;&amp;gt;0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//NFe_mod2:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trim(Replace(Mid([infNFe/infAdic/infCpl],Index([infNFe/infAdic/infCpl],'$(vTexto)'),$(vCaract)),'$(vTexto)','')) as nr_liq,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num(replace([infNFe/total/ICMSTot/vNF],'.',','),'#.##0,##') as vlr_xml0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [infNFe/emit/CNPJ] as CNPJ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileName([FILE]) as nome_arquivo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM [$(FILE)](XmlSimple, Table is [Nfe])&lt;/P&gt;&lt;P&gt;WHERE Index([infNFe/infAdic/infCpl],'$(vTexto)')&amp;lt;&amp;gt;0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #ff0000; font-size: 12pt;"&gt;&lt;STRONG style=": ; color: #ff0000; font-size: 12pt;"&gt;****&lt;/STRONG&gt;Exit For would be here*****&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;NEXT FILE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 12:41:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-for-when-condition-is-met/m-p/1411426#M514543</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-16T12:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Exit for when condition is met</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-for-when-condition-is-met/m-p/1411427#M514544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Claudio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's the exit for statement inside the for command, see the link &lt;A href="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/ScriptControlStatements/For.htm" title="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/ScriptControlStatements/For.htm"&gt;For..next ‒ QlikView&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate" style="font-size: 16px; margin: 10px 0; background-color: #f4f4f4; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;&lt;SPAN class="script_token" style="font-size: 12px;"&gt;For&lt;/SPAN&gt; &lt;SPAN class="bnf_token" style="font-size: 12px;"&gt;counter = expr1&lt;/SPAN&gt; &lt;SPAN class="script_token" style="font-size: 12px;"&gt;to&lt;/SPAN&gt; &lt;SPAN class="bnf_token" style="font-size: 12px;"&gt;expr2&lt;/SPAN&gt; [ &lt;SPAN class="script_token" style="font-size: 12px;"&gt;step&lt;/SPAN&gt; &lt;SPAN class="bnf_token" style="font-size: 12px;"&gt;expr3&lt;/SPAN&gt; ]&lt;SPAN style="color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate" style="font-size: 16px; margin: 10px 0; background-color: #f4f4f4; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;&lt;SPAN class="bnf_token" style="font-size: 12px;"&gt;[statements]&lt;/SPAN&gt;&lt;SPAN style="color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate" style="font-size: 16px; margin: 10px 0; background-color: #f4f4f4; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;&lt;STRONG&gt;[&lt;SPAN class="script_token" style="font-size: 12px;"&gt;exit for&lt;/SPAN&gt; [ ( &lt;SPAN class="script_token" style="font-size: 12px;"&gt;when&lt;/SPAN&gt; | &lt;SPAN class="script_token" style="font-size: 12px;"&gt;unless&lt;/SPAN&gt; ) &lt;SPAN class="bnf_token" style="font-size: 12px;"&gt;condition&lt;/SPAN&gt; ]&lt;/STRONG&gt;&lt;SPAN style="color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate" style="font-size: 16px; margin: 10px 0; background-color: #f4f4f4; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;&lt;SPAN class="bnf_token" style="font-size: 12px;"&gt;[statements]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate" style="font-size: 16px; margin: 10px 0; background-color: #f4f4f4; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;&lt;SPAN class="script_token" style="font-size: 12px;"&gt;Next&lt;/SPAN&gt; &lt;SPAN class="bnf_token" style="font-size: 12px;"&gt;[counter]&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate" style="font-size: 16px; margin: 10px 0; background-color: #f4f4f4; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;&lt;SPAN class="bnf_token" style="font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate" style="font-size: 16px; margin: 10px 0; background-color: #f4f4f4; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;&lt;SPAN class="bnf_token" style="font-size: 12px;"&gt;Felipe.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 13:15:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-for-when-condition-is-met/m-p/1411427#M514544</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2017-08-16T13:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Exit for when condition is met</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-for-when-condition-is-met/m-p/1411428#M514545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason for your exit for is not working because "nr_liq" is a Field and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the condition EXIT FOR when Len(nr_liq)&amp;gt;0 will not see the field nr_liq as it is not accessable out side the load statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to use Peek function to get a record value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;&lt;P&gt;Sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Aug 2017 18:35:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-for-when-condition-is-met/m-p/1411428#M514545</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2017-08-20T18:35:42Z</dc:date>
    </item>
  </channel>
</rss>

