<?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 in load statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405743#M514566</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess that is what I am unable to follow... how do the script know that the first string value has been found?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Aug 2017 18:09:08 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-08-15T18:09:08Z</dc:date>
    <item>
      <title>Exit for in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405740#M514563</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;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&amp;nbsp;&amp;nbsp; &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&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &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&amp;nbsp;&amp;nbsp; &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;&amp;nbsp;&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;***Exit For would be here*****&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>Tue, 15 Aug 2017 17:51:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405740#M514563</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-15T17:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Exit for in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405741#M514564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I see no if then... else... when and how do you know the condition is met? I guess where is the condition?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 17:56:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405741#M514564</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-08-15T17:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Exit for in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405742#M514565</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;The condition is the string I'm searching for (in this case the variable&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt; vTexto)&lt;/SPAN&gt;. I have a list of a bunch of strings and I loop through then: If I find it, it should exit my first for, otherwise, it keeps on duplicating the record since I have similar strings (eg. Num:, Num, num)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 18:02:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405742#M514565</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-15T18:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Exit for in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405743#M514566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess that is what I am unable to follow... how do the script know that the first string value has been found?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 18:09:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405743#M514566</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-08-15T18:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Exit for in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405744#M514567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I didnt make myself clear, but that's what I'm having difficulty!&lt;/P&gt;&lt;P&gt;I believe it would be something like EXIT FOR when Len(nr_liq)&amp;gt;0 but it's not working&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 18:44:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405744#M514567</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-15T18:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Exit for in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405745#M514568</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:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-for-in-load-statement/m-p/1405745#M514568</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2017-08-20T18:35:49Z</dc:date>
    </item>
  </channel>
</rss>

