<?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 How to load multiple files from a folder connection in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-load-multiple-files-from-a-folder-connection/m-p/1441884#M3268</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In QlikView I would run a loop to collect all the file names under a folder then use that to loop in and grab all the data.&amp;nbsp; In Qlik Sense I've mapped a folder connection to the folder but I don't know how to get the data out of the folder:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vFilePath = '$(vEBIFiles)';&lt;/P&gt;&lt;P&gt;searchStr = '\*.xlsx*';&amp;nbsp; &lt;/P&gt;&lt;P&gt;rootPath = '$(vFilePath)';&lt;/P&gt;&lt;P&gt;SUB DoDir (Root)&lt;/P&gt;&lt;P&gt;&amp;nbsp; FOR EACH File IN FILELIST (Root&amp;amp;searchStr) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EBI_WeeklyFiles:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt; '$(File)' as PathName,&lt;/P&gt;&lt;P&gt; '$(Root)' as Folder,&lt;/P&gt;&lt;P&gt; mid('$(File)',index('$(File)','\',-1)+1,len('$(File)')-index('$(File)','\',-1)) as FileName,&lt;/P&gt;&lt;P&gt; right('$(File)',len('$(File)')-index('$(File)','.',-1)+1) as FileExt,&lt;/P&gt;&lt;P&gt; Filesize('$(File)') as Size,&lt;/P&gt;&lt;P&gt; Filetime('$(File)') as FileTime&lt;/P&gt;&lt;P&gt; autogenerate 1;&lt;/P&gt;&lt;P&gt;next File&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Each SubDirectory in Dirlist( Root &amp;amp; '\*' )&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call DoDir(SubDirectory)&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next SubDirectory &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END SUB&lt;/P&gt;&lt;P&gt;CALL DoDir (rootPath);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Sep 2017 20:57:05 GMT</pubDate>
    <dc:creator>paulsparrow</dc:creator>
    <dc:date>2017-09-05T20:57:05Z</dc:date>
    <item>
      <title>How to load multiple files from a folder connection</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-load-multiple-files-from-a-folder-connection/m-p/1441884#M3268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In QlikView I would run a loop to collect all the file names under a folder then use that to loop in and grab all the data.&amp;nbsp; In Qlik Sense I've mapped a folder connection to the folder but I don't know how to get the data out of the folder:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vFilePath = '$(vEBIFiles)';&lt;/P&gt;&lt;P&gt;searchStr = '\*.xlsx*';&amp;nbsp; &lt;/P&gt;&lt;P&gt;rootPath = '$(vFilePath)';&lt;/P&gt;&lt;P&gt;SUB DoDir (Root)&lt;/P&gt;&lt;P&gt;&amp;nbsp; FOR EACH File IN FILELIST (Root&amp;amp;searchStr) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EBI_WeeklyFiles:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt; '$(File)' as PathName,&lt;/P&gt;&lt;P&gt; '$(Root)' as Folder,&lt;/P&gt;&lt;P&gt; mid('$(File)',index('$(File)','\',-1)+1,len('$(File)')-index('$(File)','\',-1)) as FileName,&lt;/P&gt;&lt;P&gt; right('$(File)',len('$(File)')-index('$(File)','.',-1)+1) as FileExt,&lt;/P&gt;&lt;P&gt; Filesize('$(File)') as Size,&lt;/P&gt;&lt;P&gt; Filetime('$(File)') as FileTime&lt;/P&gt;&lt;P&gt; autogenerate 1;&lt;/P&gt;&lt;P&gt;next File&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Each SubDirectory in Dirlist( Root &amp;amp; '\*' )&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call DoDir(SubDirectory)&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next SubDirectory &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END SUB&lt;/P&gt;&lt;P&gt;CALL DoDir (rootPath);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2017 20:57:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-load-multiple-files-from-a-folder-connection/m-p/1441884#M3268</guid>
      <dc:creator>paulsparrow</dc:creator>
      <dc:date>2017-09-05T20:57:05Z</dc:date>
    </item>
  </channel>
</rss>

