<?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: help with nested loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/help-with-nested-loop/m-p/774556#M665528</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wrap another loop around and change the Dir assignment like this ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each d in 'C:\Test1\Temp','C:\Test2\Temp','C:\Temp\Test'&lt;/P&gt;&lt;P&gt;Let Dir = '$(d)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{rest of current code}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next d;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Dec 2014 13:46:13 GMT</pubDate>
    <dc:creator>flipside</dc:creator>
    <dc:date>2014-12-22T13:46:13Z</dc:date>
    <item>
      <title>help with nested loop</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-nested-loop/m-p/774555#M665527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following loop within my script..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET Dir = 'C:\Test1\Temp';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT32 TO [DBF Driver];&lt;/P&gt;&lt;P&gt;SET errormode = 0;&lt;/P&gt;&lt;P&gt;For each file in FileList('$(Dir)\*.DBF')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vFilename = subfield(subfield('$(file)', '\', -1),'.',1);&lt;/P&gt;&lt;P&gt;If len(subfield('$(file)','\',-1))&amp;gt;12 then&lt;/P&gt;&lt;P&gt;LET Data = chr(96) &amp;amp; '$(Dir)' &amp;amp; chr(96) &amp;amp; '\' &amp;amp; chr(96) &amp;amp; Subfield(GetShortName('$(file)'),'\',-1) &amp;amp; chr(96);&lt;/P&gt;&lt;P&gt;else &lt;/P&gt;&lt;P&gt;LET Data = chr(96) &amp;amp; '$(Dir)' &amp;amp; chr(96) &amp;amp; '\' &amp;amp; chr(96) &amp;amp; Subfield('$(file)','\',-1) &amp;amp; chr(96);&lt;/P&gt;&lt;P&gt;ENDIF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM $(Data);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET errormode = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE Data into &lt;C&gt;;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE Data;&lt;/P&gt;&lt;P&gt;NEXT file;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say i have multiple directories, what i want to do is loop through the multiple directories and perform the above loop in each. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if my directories are :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Test1\Temp&lt;/P&gt;&lt;P&gt;C:\Test2\Temp&lt;/P&gt;&lt;P&gt;C:\Temp\Test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how would i list those directories then get a loop to go to the first one, run the above loop then go to the 2nd one, run the above loop then again with the 3rd directory. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 13:24:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-nested-loop/m-p/774555#M665527</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2014-12-22T13:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: help with nested loop</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-nested-loop/m-p/774556#M665528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wrap another loop around and change the Dir assignment like this ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each d in 'C:\Test1\Temp','C:\Test2\Temp','C:\Temp\Test'&lt;/P&gt;&lt;P&gt;Let Dir = '$(d)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{rest of current code}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next d;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 13:46:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-nested-loop/m-p/774556#M665528</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2014-12-22T13:46:13Z</dc:date>
    </item>
  </channel>
</rss>

