<?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 Multiple file load with file name range in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136455#M730</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;I'm new to the forum, thanks for all the input I've found here already! I've seen several ways to load multiple files from a folder. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;I haven't found a good solution to load a number of files based on a range in their filenam. I'm reaching out to see if multiple methods could be combined to a simple solution. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;I have a few requimrents:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Load all files&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Load a range of files&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Keep the script as short or simple as possible. Short scripts are easier to teach to others.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Keep the performance ok&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Should work with preceeding load&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;I currently know of the following 4 methods:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Load all files with wildcard in FROM statement. Works fine for all files in a folder.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Load all files with wildcard using Filelist function. Works fine for all files in a folder. Can also work with preceeding load.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Load all files with wildcard and a WHERE statement to only load the desired file name range. This method works, but checks each file for the WHERE statement. This makes the script very slow.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Load a range of files using duplicate script. It starts a table from a certain variable and for each file until the next variable it concatenates the next file. Works with name range, but the full load script (all column calculations etc..) is duplicated, which looks very messy. &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the solution should be in the filelist method. The range would be properly captured with either another function or a variable. The result could then be put in the filelist function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an idea how to script this? &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Let's assume I have the following files in 1 folder I want to load from.:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180814.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180813.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180810.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180809.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180808.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180807.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180806.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180803.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180802.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the current filelist script which works fine for all files, but not for a range of files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR EACH File in filelist('lib://.......\*.xlsx');&lt;/P&gt;&lt;P&gt;SET vFile = '$(File)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('Map1',[ColumnX],null()) as "MappedValue";&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileBaseName() as "FileName",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(date#(FileBaseName(),'YYMMDD'),'DD-MM-YYYY') as "FileDate",&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; FROM [$(vFile)] (ooxml, embedded labels, table is Sheet1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEXT File;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Aug 2018 12:04:45 GMT</pubDate>
    <dc:creator>michiel_</dc:creator>
    <dc:date>2018-08-14T12:04:45Z</dc:date>
    <item>
      <title>Multiple file load with file name range</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136455#M730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;I'm new to the forum, thanks for all the input I've found here already! I've seen several ways to load multiple files from a folder. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;I haven't found a good solution to load a number of files based on a range in their filenam. I'm reaching out to see if multiple methods could be combined to a simple solution. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;I have a few requimrents:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Load all files&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Load a range of files&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Keep the script as short or simple as possible. Short scripts are easier to teach to others.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Keep the performance ok&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Should work with preceeding load&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;I currently know of the following 4 methods:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Load all files with wildcard in FROM statement. Works fine for all files in a folder.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Load all files with wildcard using Filelist function. Works fine for all files in a folder. Can also work with preceeding load.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Load all files with wildcard and a WHERE statement to only load the desired file name range. This method works, but checks each file for the WHERE statement. This makes the script very slow.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Load a range of files using duplicate script. It starts a table from a certain variable and for each file until the next variable it concatenates the next file. Works with name range, but the full load script (all column calculations etc..) is duplicated, which looks very messy. &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the solution should be in the filelist method. The range would be properly captured with either another function or a variable. The result could then be put in the filelist function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an idea how to script this? &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Let's assume I have the following files in 1 folder I want to load from.:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180814.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180813.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180810.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180809.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180808.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180807.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180806.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180803.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;180802.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the current filelist script which works fine for all files, but not for a range of files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR EACH File in filelist('lib://.......\*.xlsx');&lt;/P&gt;&lt;P&gt;SET vFile = '$(File)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('Map1',[ColumnX],null()) as "MappedValue";&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileBaseName() as "FileName",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(date#(FileBaseName(),'YYMMDD'),'DD-MM-YYYY') as "FileDate",&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; FROM [$(vFile)] (ooxml, embedded labels, table is Sheet1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEXT File;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2018 12:04:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136455#M730</guid>
      <dc:creator>michiel_</dc:creator>
      <dc:date>2018-08-14T12:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple file load with file name range</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136456#M731</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;How about adding a step before the "For Each" look where you load the File names into a Temp Table where you load Filenames based on the range conditions and then use those file names for your For Each clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That way you will only load data for the filenames that are picked up on certain conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this example on the forum which kind of illustrates the same, except that here they have noted which ones they &lt;STRONG&gt;do not want to include&lt;/STRONG&gt; and check against that kind of list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ExceptionList:&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Concat(Chr(39) &amp;amp; Name &amp;amp; Chr(39),', ') as FileList;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * INLINE [&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; File1&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; File2&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; File3&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; File4&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; File5&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vFileList = Peek('FileList');&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table ExceptionList;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data:&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *,&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Filebasename() as FileName FROM&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;C&gt;&amp;nbsp; &lt;/C&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(qvd) Where Not Match(FileBaseName(), $(vFileList));&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Al&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 06:34:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136456#M731</guid>
      <dc:creator>bwisealiahmad</dc:creator>
      <dc:date>2018-08-15T06:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple file load with file name range</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136457#M732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For me it's not really clear what do you want to do but I assume that you want to load only certain files from a folder. In regard to your example it seems quite easy with something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR EACH File in filelist('lib://.......\*.xlsx');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vDate = (year(today()-14)-2000)*10000+(month(today()-14)*100)+day(today()-14);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if subfield(subfield('$(File)', '\', -1), '.', 1) &amp;gt;= $(vDate) then&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; Table: Load *&lt;SPAN&gt; FROM [$(File)] (ooxml, embedded labels, table is Sheet1)&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to load for example the files from the last 14 days - with subfield() or any other string-functions could extract any information from the filename (and this without loading these files) and only if this information matched with your condition the file will be loaded. This meant it depends on the decoded information within the filename and your condition how easy it is to implement. By only period-related information it's often quite simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 09:22:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136457#M732</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-15T09:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple file load with file name range</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136458#M733</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;This looks like a good idea! Tried it, When I only use the PeriodMin, it still loads all files. When I use both parameters like the the following script, no files are loaded (while there are files which match the criteria. I've tried to Num() to all statements, but no luck. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR EACH File in filelist('lib://...\*.xlsx');&lt;/P&gt;&lt;P&gt;SET vFile = '$(File)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vDate.PeriodMin = 180710; &lt;/P&gt;&lt;P&gt;Let vDate.PeriodMax = 180716; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If subfield(subfield('$(File)', '\', -1), '.', 1) &amp;gt;= '$(vDate.PeriodMin)' &lt;/P&gt;&lt;P&gt;and subfield(subfield('$(File)', '\', -1), '.', 1) &amp;lt;= '$(vDate.PeriodMax)' &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt; FROM [$(vFile)] (ooxml, embedded labels, table is Blad2)&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;&lt;/P&gt;&lt;P&gt;NEXT File;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 10:38:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136458#M733</guid>
      <dc:creator>michiel_</dc:creator>
      <dc:date>2018-08-21T10:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple file load with file name range</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136459#M734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe the extract of the period from the filename didn't work like expected. To check this place the following below your period-variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vCheck = subfield(subfield('$(File)', '\', -1), '.', 1);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TRACE&lt;/STRONG&gt; '$(vCheck)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then you will see the result within the load progress-window and within the log-file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I look again I assume the issue are the single-quotes around your variables by their call because they make the content to a string and not a number. Therefore try it in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;If subfield(subfield('$(File)', '\', -1), '.', 1) &amp;gt;= &lt;STRONG&gt;$(vDate.PeriodMin)&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;and subfield(subfield('$(File)', '\', -1), '.', 1) &amp;lt;= &lt;STRONG&gt;$(vDate.PeriodMax)&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; then&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, 21 Aug 2018 17:05:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136459#M734</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-21T17:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple file load with file name range</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136460#M735</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;Thanks a million for all the input. I've kept on searching around and have combined the solution i wanted now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I load all the filenames into a table. This is super quick. Next to the full filename I load whatever I want to select on. In this case there is a list list with incremental file ID's like:&lt;/P&gt;&lt;P&gt;Test_1234&lt;/P&gt;&lt;P&gt;Test_1235&lt;/P&gt;&lt;P&gt;Test_1236&lt;/P&gt;&lt;P&gt;Test_1237&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a resident load I can then select the required files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I For...Next through the list of selected files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to &lt;A href="https://gist.github.com/mountaindude/fbfefce78ac5e3ba4d5a" title="https://gist.github.com/mountaindude/fbfefce78ac5e3ba4d5a"&gt;https://gist.github.com/mountaindude/fbfefce78ac5e3ba4d5a&lt;/A&gt; for the first bit of script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to &lt;A href="https://community.qlik.com/qlik-users/208667"&gt;atkinsow&lt;/A&gt;‌ for the last push in the thread &lt;A href="https://community.qlik.com/message/1192589"&gt;Re: load files with specific names from folder through for loop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15404718952393390" jivemacro_uid="_15404718952393390"&gt;
&lt;P style="font-size: 13.3333px;"&gt;For each Filename in 'lib://.....\'&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sub DoDir (Root)&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each Ext in 'qvd'&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&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; for each File in filelist (Root&amp;amp;'\Test*.' &amp;amp;Ext)&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&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; QVD_Files:&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&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;&amp;nbsp;&amp;nbsp; Load '$(File)' as Filename,&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&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;&amp;nbsp;&amp;nbsp; Subfield('$(File)','/',-1) as QVDName,&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&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;&amp;nbsp;&amp;nbsp; Left(SubField('$(File)','_',-1),Len(SubField('$(File)','_',-1))-4) as QVDInteger&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileSize( '$(File)' ) as QVDSize,&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileTime( '$(File)' ) as QVDFileTime&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&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; autogenerate 1;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&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; next File&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; next Ext&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;// Uncomment if you need to include QVDs in subdirectories&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each Dir in dirlist (Root&amp;amp;'\*' )&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&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; call DoDir (Dir)&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; next Dir&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end sub&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;call DoDir ('$(Filename)')&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;next;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;SelectedFiles:&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;Load&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;Filename&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;Resident QVD_Files&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;Where QVDInteger &amp;gt;= 1235 and QVDInteger &amp;lt;= 1237;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;Drop table QVD_Files;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;LET NumRows=FieldValueCount('Filename');&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;FOR i=1 to $(NumRows)&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;LET vFile = peek('Filename',$(i)-1,'SelectedFiles');&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;let vQVD= ('$(vFile)');&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;Table:&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;Load *;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;Concatenate Load * From ['$(vQVD)'] (qvd);&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;next;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Drop table &lt;SPAN style="font-size: 13.3333px;"&gt;SelectedFiles&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2018 12:52:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/136460#M735</guid>
      <dc:creator>michiel_</dc:creator>
      <dc:date>2018-10-25T12:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple file load with file name range</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/1525457#M3506</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Next to the solution described above, I've also found another solution with the help of a colleague.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;FOR period = 10001 TO 10101
                IF NOT ISNULL(QVDCREATETIME('lib://PATH\FILE$(period).qvd')) THEN

Table:
LOAD
*,
FROM [lib://PATH\FILE$(period).qvd]
(qvd);
END IF
NEXT;
;&lt;/PRE&gt;&lt;P&gt;Using this method, any range will be possible in files while not having to look in each file. The QVDCREATETIME function is used to skip missing files in the range.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really like this solution as the script is small and fast.&lt;/P&gt;&lt;P&gt;Hope this can be of help for anyone else:)&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2019 14:05:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-file-load-with-file-name-range/m-p/1525457#M3506</guid>
      <dc:creator>michiel_</dc:creator>
      <dc:date>2019-01-02T14:05:33Z</dc:date>
    </item>
  </channel>
</rss>

