<?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: Loop through files in folder and load into same table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637158#M596035</link>
    <description>&lt;P&gt;THANKS!&lt;/P&gt;&lt;P&gt;It was exactly this I was looking for.&lt;/P&gt;&lt;P&gt;Didn't have the imagination to just create a dummy field in the tmp table making it possible to use the concatenate.&lt;/P&gt;&lt;P&gt;Enjoy the weekend!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2019 12:25:21 GMT</pubDate>
    <dc:creator>arhadisqlik</dc:creator>
    <dc:date>2019-10-18T12:25:21Z</dc:date>
    <item>
      <title>Loop through files in folder and load into same table</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637075#M596031</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;I'm struggling with a for each loop that should loop through a all subfolders in a given folder path and load content of excel files into the same table.&lt;/P&gt;&lt;P&gt;The problem is that everytime it iterates to a new file and starts the load it increments the tablename.&lt;/P&gt;&lt;P&gt;My code looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set vRoot = 'C:\QlikView Storage\Group88\Data\NewFileFomats\*';&lt;/P&gt;&lt;P&gt;for Each dir in DirList(vRoot)&lt;/P&gt;&lt;P&gt;for Each file in Filelist('$(dir)\*.xlsx')&lt;/P&gt;&lt;P&gt;tmp:&lt;BR /&gt;load&lt;BR /&gt;*&lt;BR /&gt;from&lt;BR /&gt;[$(file)\*.xlsx](ooxml, embedded labels, table is 'Import QW');&lt;/P&gt;&lt;P&gt;next;&lt;/P&gt;&lt;P&gt;Loadresult:&lt;BR /&gt;load * Resident tmp;&lt;/P&gt;&lt;P&gt;drop table tmp;&lt;/P&gt;&lt;P&gt;next;&lt;/P&gt;&lt;P&gt;As is there are 3 subfolders in the path&amp;nbsp;C:\QlikView Storage\Group88\Data\NewFileFomats\* and it iterates through them all and loads the files but at the end I'm left with "temp-1" table, no Loadresult-table&amp;nbsp; and it only has data from one file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know it is possible to load all files from a folder into the same table using something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tmp:&lt;/P&gt;&lt;P&gt;Load * from&amp;nbsp;&lt;/P&gt;&lt;P&gt;[C:\QlikView Storage\Group88\Data\NewFileFomats\Loewe\*.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Import QW);&lt;/P&gt;&lt;P&gt;But how do implement this behaviour in the loop?&lt;/P&gt;&lt;P&gt;Thanks in advance for the help.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 09:57:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637075#M596031</guid>
      <dc:creator>arhadisqlik</dc:creator>
      <dc:date>2019-10-18T09:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through files in folder and load into same table</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637089#M596032</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;set vRoot = 'C:\QlikView Storage\Group88\Data\NewFileFomats\*';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;for Each dir in DirList(vRoot)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; for Each file in Filelist('$(dir)\*.xlsx')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; tmp:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; from&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [$(file)](ooxml, embedded labels, table is 'Import QW')&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; next&amp;nbsp;file ;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;next&amp;nbsp;dir ;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 10:22:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637089#M596032</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-10-18T10:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through files in folder and load into same table</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637112#M596033</link>
      <description>&lt;P&gt;Hi Vegar&lt;/P&gt;&lt;P&gt;Thank you for the feedback.&lt;/P&gt;&lt;P&gt;Unfortunately it did not do the trick.&lt;/P&gt;&lt;P&gt;I ended up with four temp-tables (there are four files in three folders) tmp, tmp-1, tmp-2, tmp-3.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Anders&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 11:08:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637112#M596033</guid>
      <dc:creator>arhadisqlik</dc:creator>
      <dc:date>2019-10-18T11:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through files in folder and load into same table</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637146#M596034</link>
      <description>&lt;P&gt;I see, the autoconcatenate feature in doesn't seem to work. You'll need to explicit use the concatenate.&amp;nbsp; See my suggestion below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;set vRoot = 'C:\QlikView Storage\Group88\Data\NewFileFomats\*';
tmp:
LOAD * inline [
DummyField
]
for Each dir in DirList(vRoot)
  for Each file in Filelist('$(dir)\*.xlsx')
      Concatenate (tmp) load
        *
      from
        [$(file)](ooxml, embedded labels, table is 'Import QW')
      ;
    next file ;
next dir ;
DROP FIELD DummyField&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 12:03:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637146#M596034</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-10-18T12:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through files in folder and load into same table</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637158#M596035</link>
      <description>&lt;P&gt;THANKS!&lt;/P&gt;&lt;P&gt;It was exactly this I was looking for.&lt;/P&gt;&lt;P&gt;Didn't have the imagination to just create a dummy field in the tmp table making it possible to use the concatenate.&lt;/P&gt;&lt;P&gt;Enjoy the weekend!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 12:25:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637158#M596035</guid>
      <dc:creator>arhadisqlik</dc:creator>
      <dc:date>2019-10-18T12:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through files in folder and load into same table</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637164#M596036</link>
      <description>&lt;P&gt;You don't need to use a dummy field. You can even use one or several field that you know exist in the excels. If you do that you won't need to use drop command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD * [&lt;BR /&gt;ExcelCol1, ExcelCol2&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 12:39:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-files-in-folder-and-load-into-same-table/m-p/1637164#M596036</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-10-18T12:39:33Z</dc:date>
    </item>
  </channel>
</rss>

