<?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: Question About Loop (Foreach) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031504#M348227</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still Doesn't work, I attached a simple path, could you pls put your example in the path, If the script works for you i guess should works for me. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Apr 2016 21:06:08 GMT</pubDate>
    <dc:creator>pgalvezt</dc:creator>
    <dc:date>2016-04-04T21:06:08Z</dc:date>
    <item>
      <title>Question About Loop (Foreach)</title>
      <link>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031500#M348223</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;Im trying to load diferents xls files into subfolders into a main folder and I Try to follow this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL class="dp-xml" start="1" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #5c5c5c; margin: 0 0 1px 45px !important;"&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;for Each dir in DirList('yourpathgoeshere') &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&amp;nbsp; for Each file in FileList('$(dir)\*.csv') // or .txt (What I should to put here in &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;'$(dir)\&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp; if filesize('$(file)') &amp;gt; 0 then &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp: &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD * &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [$(file)](txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp; end if&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&amp;nbsp; next; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&amp;nbsp; store tmp into [$(dir).csv](txt); &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&amp;nbsp; drop table tmp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;next&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;In my script i have this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: inherit; color: black; background-color: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;for Each dir in DirList('C:\Users\pgalvez\Desktop\QLIKVIEW 2016\')&lt;/P&gt;&lt;P&gt;&amp;nbsp; for Each file in FileList ('$(dir)\*.xls')&lt;/P&gt;&lt;P&gt;// if filesize('$(file)') &amp;gt; 0 then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp:&lt;/P&gt;&lt;P&gt;LOAD *&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Root]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is GENERAL$, filters(&lt;/P&gt;&lt;P&gt;Remove(Row, Pos(Top, 6)),&lt;/P&gt;&lt;P&gt;Remove(Row, Pos(Top, 5)),&lt;/P&gt;&lt;P&gt;Remove(Row, Pos(Top, 4)),&lt;/P&gt;&lt;P&gt;Remove(Row, Pos(Top, 3)),&lt;/P&gt;&lt;P&gt;Remove(Row, Pos(Top, 2)),&lt;/P&gt;&lt;P&gt;Remove(Row, Pos(Top, 1))&lt;/P&gt;&lt;P&gt;));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//end if&lt;/P&gt;&lt;P&gt;&amp;nbsp; Next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//STORE tempINTO '$(dir)\*.xls'.qvd(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But Doesn't work, QlikView read nothing Pleas help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 20:45:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031500#M348223</guid>
      <dc:creator>pgalvezt</dc:creator>
      <dc:date>2016-03-31T20:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Question About Loop (Foreach)</title>
      <link>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031501#M348224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;&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;for Each dir in DirList('C:\Users\pgalvez\Desktop\QLIKVIEW 2016')&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ remove last \&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for Each file in FileList ('$(dir)\*.xls')&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace $(file);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 21:18:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031501#M348224</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2016-03-31T21:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Question About Loop (Foreach)</title>
      <link>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031502#M348225</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;Thanks for your replying but doesn't work, QlikView show me nothing...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 21:22:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031502#M348225</guid>
      <dc:creator>pgalvezt</dc:creator>
      <dc:date>2016-03-31T21:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Question About Loop (Foreach)</title>
      <link>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031503#M348226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do you have files in the folder?&lt;/P&gt;&lt;P&gt;this works (I get a list of files in the script execution progress) on my Qlik&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;for Each dir in DirList('C:\Users\mgrossi\Downloads')&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; for Each file in FileList ('$(dir)\*.xls')&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; trace $(file);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; NEXT&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; NEXT&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 21:35:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031503#M348226</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2016-03-31T21:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Question About Loop (Foreach)</title>
      <link>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031504#M348227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still Doesn't work, I attached a simple path, could you pls put your example in the path, If the script works for you i guess should works for me. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2016 21:06:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031504#M348227</guid>
      <dc:creator>pgalvezt</dc:creator>
      <dc:date>2016-04-04T21:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Question About Loop (Foreach)</title>
      <link>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031505#M348228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the below script,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14598205168997917" jivemacro_uid="_14598205168997917" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;Sub ScanFolder(Root) &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each FileExtension in 'xlsx' &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each FoundFile in Filelist( Root &amp;amp; '\*.' &amp;amp; FileExtension) &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load&amp;nbsp; A as FieldValues,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Subfield('$(FoundFile)','\',SubStringCount('$(FoundFile)','\')+1) as FileName&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [$(FoundFile)] (ooxml, no labels, table is [Hoja1]);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next FoundFile &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next FileExtension &lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each SubDirectory in Dirlist( Root &amp;amp; '\*' ) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call ScanFolder(SubDirectory) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next SubDirectory &lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;End Sub &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Call ScanFolder('C:\Users\Tamil\Desktop\Prueba Buscar Archivos') ;&amp;nbsp; // change your path accordingly&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;IMG __jive_id="120457" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/120457_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Sample QVW file attached against your sample data.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2016 01:49:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031505#M348228</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2016-04-05T01:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Question About Loop (Foreach)</title>
      <link>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031506#M348229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally, I could link all my script to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ty &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2016 13:56:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-About-Loop-Foreach/m-p/1031506#M348229</guid>
      <dc:creator>pgalvezt</dc:creator>
      <dc:date>2016-04-05T13:56:41Z</dc:date>
    </item>
  </channel>
</rss>

