<?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: Problem with FOR_EACH loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815233#M287530</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that is a valid assumption - but no, it doesn't. I have several other FOR EACH loops where I use the DIRECTORY and then a filelist which only holds the filename itself.&lt;/P&gt;&lt;P&gt;I will look for another way to do this.&lt;/P&gt;&lt;P&gt;It is possible to use the * just for the middle part of a file_name and specify something at the end, isn't it&lt;BR /&gt;(like &amp;gt;&amp;gt; Staplerliste*(Master) &amp;lt;&amp;lt;)&lt;/P&gt;&lt;P&gt;to rule out files that have something more behind that &amp;gt; (Master) &amp;lt; in the file_name.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Mar 2015 09:12:50 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2015-03-17T09:12:50Z</dc:date>
    <item>
      <title>Problem with FOR_EACH loop</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815229#M287526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some issue with a FOR EACH loop. It's not the first time I use it, but I guess it's some stupid little mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will just post my code here.&lt;/P&gt;&lt;P&gt;The issue is, in this directory there's files in .xls format and some in .xlsx format, so I guess I will need two loops. The first one should go after the .xlsx files - but apparently, nothing is found to match, the loop is simply skipped.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DIRECTORY '&lt;S&gt;'; // In this directory, there should be 2 files with the ending .xlsx;&lt;/S&gt;&lt;/P&gt;&lt;P&gt;// The file_path is correct, I have tested it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SET v_Filemask = 'Staplerliste*.xlsx';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FOR EACH v_File IN FileList ('$(v_Filemask)')&lt;BR /&gt;Hilfstab_pre:&lt;BR /&gt;FIRST 1 LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileName() as Dateiname&lt;BR /&gt;From&lt;BR /&gt;$(v_File) (ooxml, no labels);&lt;BR /&gt;NEXT v_File&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone spot the error here?&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 08:58:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815229#M287526</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-03-17T08:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FOR_EACH loop</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815230#M287527</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;Looks OK to me, except possibly for the (unnecessary) decoration in the DIRECTORY line (the square brackets and quotes are not required). If the XLS loop works using the same logic, then that is probably not the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 09:05:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815230#M287527</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-03-17T09:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FOR_EACH loop</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815231#M287528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that filelist need a fullpath and didn't regognize a directory-statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 09:07:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815231#M287528</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-03-17T09:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FOR_EACH loop</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815232#M287529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try replacing the variable with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR EACH v_File IN FileList ('S:\Common\31 Maintenance\Stapler\Staplerliste*.xlsx')&lt;/P&gt;&lt;P&gt;or use one of the known filenames to test (ie not using wildcards)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your From statement should read:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; From [$(vFile)]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as their is a space in the path name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit = I think Marcus is correct&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 09:08:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815232#M287529</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-03-17T09:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FOR_EACH loop</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815233#M287530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that is a valid assumption - but no, it doesn't. I have several other FOR EACH loops where I use the DIRECTORY and then a filelist which only holds the filename itself.&lt;/P&gt;&lt;P&gt;I will look for another way to do this.&lt;/P&gt;&lt;P&gt;It is possible to use the * just for the middle part of a file_name and specify something at the end, isn't it&lt;BR /&gt;(like &amp;gt;&amp;gt; Staplerliste*(Master) &amp;lt;&amp;lt;)&lt;/P&gt;&lt;P&gt;to rule out files that have something more behind that &amp;gt; (Master) &amp;lt; in the file_name.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 09:12:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815233#M287530</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-03-17T09:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FOR_EACH loop</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815234#M287531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In general it should work - I guess there is a small syntax issue, maybe with the directory and/or the variable-staement, try to trace the path to see what is wrong. This for example worked:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub DoDir(Root)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each Ext in 'qvw', 'qvd' //, 'qvo', 'qvs', 'qvt', 'txt', 'csv', 'xls', 'xlsx'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each File in filelist (Root&amp;amp;'\*.'&amp;amp;Ext)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 09:28:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FOR-EACH-loop/m-p/815234#M287531</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-03-17T09:28:03Z</dc:date>
    </item>
  </channel>
</rss>

