<?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 and Load excel files in a folder in reverse order in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424611#M429273</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;Much appreciated for this - I didnt spot that !&amp;nbsp; Is there a way of leaving out the "&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, table is 'Sheet1'" &lt;/STRONG&gt;section as I have&amp;nbsp; noticed that the sheet names never have the same name ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Sep 2017 09:14:07 GMT</pubDate>
    <dc:creator>prees959</dc:creator>
    <dc:date>2017-09-28T09:14:07Z</dc:date>
    <item>
      <title>Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424603#M429265</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;Every day we receive a new Excel file with the dates contained in the filename eg, DataRun_20170927_20171127.xlsx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need to do is loop through the folder that these files are in and load with in order of the most recent one received with a&lt;/P&gt;&lt;P&gt;Where Not Exists on an ID field so in effect it is bringing in the most upto date records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 09:42:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424603#M429265</guid>
      <dc:creator>prees959</dc:creator>
      <dc:date>2017-09-27T09:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424604#M429266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;quite not sure if i really understood your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you could try&amp;nbsp; replacing parts of the locations by a variable (vPath) in order to dynamically catch the correct daily excel file&lt;/P&gt;&lt;P&gt;and combining this with incremental Load e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15065089342351504 jive_text_macro" jivemacro_uid="_15065089342351504" modifiedtitle="true"&gt;
&lt;P&gt;Let vPath = 'DataRun_'&amp;amp;date(date#(Today()),'YYYYMMDD')&amp;amp;'_'&amp;amp;date(date#(Today())+60,'YYYY')&amp;amp;date(date#(Today())+60,'MM')&amp;amp;date(date#(Today()),'DD');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//historicData:&lt;/P&gt;
&lt;P&gt;//LOAD ID, &lt;/P&gt;
&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DIM&lt;/P&gt;
&lt;P&gt;//FROM&lt;/P&gt;
&lt;P&gt;//&lt;C&gt;(qvd);&lt;/C&gt;&lt;/P&gt;
&lt;P&gt;//Concatenate&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;actualData:&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;
&lt;P&gt;(ooxml, embedded labels, table is Tabelle1);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Store historicData into &lt;C&gt;(qvd);&lt;/C&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 10:46:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424604#M429266</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2017-09-27T10:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424605#M429267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for you reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To explain it a bit better, Every day the number of excel files grows by one which I need to loop through eg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As of yesterday's , I had these files in a folder :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data_20170921_20171121.xlsx&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;data_20170922_20171122.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;data_20170923_20171123.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;data_20170924_201711214xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;data_20170925_20171125.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;data_20170926_20171126.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Today a '&lt;SPAN style="font-size: 13.3333px;"&gt;data_20170927_20171127.xlsx' file will be dumped into the folder...&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which I have been&amp;nbsp; loading one-by-one into a single qvd called [all_data.qvd]. I have been doing it in reverse order 26th, 25th etc to get the most upto date data by using where not exists' on a key ID field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a automatic way I can loop through the folder ensuring that I pick the latest file first before the next one and using Where Not Exists on the key ID field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 14:53:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424605#M429267</guid>
      <dc:creator>prees959</dc:creator>
      <dc:date>2017-09-27T14:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424606#M429268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like this would work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcus&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each file in FileList('$(vFolder)DataRun*.xlsx')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRACE found file $(file);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TempFileList:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subfield('$(file)','\', -1) as tempFileName, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(file)' as tempFullFileName, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; right(subfield(subfield('$(file)','\', -1), '.', 1), &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; as tempFileDate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AUTOGENERATE 1;&lt;/P&gt;&lt;P&gt;next file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OrderedFileList:&lt;/P&gt;&lt;P&gt;NOCONCATENATE &lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tempFileName as FileName, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tempFullFileName as FullFileName, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tempFileDate as FileDatev2&lt;/P&gt;&lt;P&gt;RESIDENT TempFileList&lt;/P&gt;&lt;P&gt;ORDER BY tempFileDate desc //retrieve most recent files first&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE TempFileList;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for n = 1 to NoOfRows('OrderedFileList')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vCurrentFile = peek('FileName', n-1, 'OrderedFileList');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vCurrentFileDateStamp = peek('FileDatev2', n-1, 'OrderedFileList');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRACE ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRACE $(vCurrentFile);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRACE $(vCurrentFileDateStamp);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [field list]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [$(vFolder)$(vCurrentFile)] &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOT Exists(PrimaryKeyField)&lt;/P&gt;&lt;P&gt;next n&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not isnull(QvdCreateTime('$(vQVDFolder)Data.QVD')) then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONCATENATE (Data)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [field list]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [$(vQVDFolder)Data.QVD] &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOT Exists(PrimaryKeyField)&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE OrderedFileList;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 15:04:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424606#M429268</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2017-09-27T15:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424607#M429269</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;Thanks for this - it seems to start well then fails on :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Data:&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [field list]&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [$(vFolder)$(vCurrentFile)]&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOT Exists(PrimaryKeyField)&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;next n&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and produces the following error :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cannot open file 'C:\QVAPPS\Data\&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DataRun&lt;/SPAN&gt;_20170926_20171126.xlsx&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOT EXISTS' The filename, directory name, or volume label syntax is incorrect.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [field list]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM &lt;C&gt;&lt;/C&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOT EXISTS([ID])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have exit'ed the script just before this step and the vFolder and vCurrentFile have the correct path and filename of the most recent file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really grateful for this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 17:59:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424607#M429269</guid>
      <dc:creator>prees959</dc:creator>
      <dc:date>2017-09-27T17:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424608#M429270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks to me like you are missing a ']' closing brace.&amp;nbsp; What does the log file show? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 23:31:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424608#M429270</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2017-09-27T23:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424609#M429271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;think that you need a further specifyer for the excel, like&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ......&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM &lt;C&gt;&lt;/C&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (biff, embedded labels, table is Sheet1$)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOT EXISTS([ID])&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2017 07:18:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424609#M429271</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2017-09-28T07:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424610#M429272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my bad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need to add the format specification in the xlsx load. This will be sopmethign like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [$(vFolder)$(vCurrentFile)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;(ooxml, embedded labels, table is 'Sheet1')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOT Exists(PrimaryKeyField)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd suggest building the xlsx part of the load script by setting up a load using the wizard, then copying into my code (substituting in variables where relevant)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2017 07:45:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424610#M429272</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2017-09-28T07:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424611#M429273</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;Much appreciated for this - I didnt spot that !&amp;nbsp; Is there a way of leaving out the "&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, table is 'Sheet1'" &lt;/STRONG&gt;section as I have&amp;nbsp; noticed that the sheet names never have the same name ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2017 09:14:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424611#M429273</guid>
      <dc:creator>prees959</dc:creator>
      <dc:date>2017-09-28T09:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424612#M429274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes there is a way. You'll need the Excel ODBC driver installed though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just prior to the Excel load, try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO [Excel Files;DBQ=$(vFolder)$(vCurrentFile)];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//use SQLTables to assemble a list of all the sheets in this Excel file&lt;/P&gt;&lt;P&gt;XLSSheetList:&lt;/P&gt;&lt;P&gt;SQLTables&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;DISCONNECT; //from excel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vXLSXSheet = peek('TABLE_NAME', 0, 'XLSSheetList');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE XLSSheetList;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then substitute in your vXLSXSheet in your subsequent load 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>Thu, 28 Sep 2017 09:58:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424612#M429274</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2017-09-28T09:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424613#M429275</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;I seem to be getting an error in the load again :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field not found - &amp;lt;field list&amp;gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [field list]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;C:\QVAPPS\Data\&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;DataRun&lt;/SPAN&gt;_20170926_20171126.xlsx&lt;/STRONG&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (ooxml, embedded labels,table is @1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on this one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 09:43:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424613#M429275</guid>
      <dc:creator>prees959</dc:creator>
      <dc:date>2017-10-02T09:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424614#M429276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you're going to need to specify the list of fields from your data source. I included [field list] as a placeholder for you to substitute in your own fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 11:03:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424614#M429276</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2017-10-02T11:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424615#M429277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aaah , Thanks Marcus.&amp;nbsp;&amp;nbsp; Yes - all sorted now thanks again for your help.&amp;nbsp; Really useful script!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 11:05:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424615#M429277</guid>
      <dc:creator>prees959</dc:creator>
      <dc:date>2017-10-02T11:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424616#M429278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following on from this solution, I create a daily qvd&amp;nbsp; so I have a daily historical snapshot of all the records that come through the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment I have a list of qvd's :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;records_as_at_20171001.qvd&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;records_as_at_20171002.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;records_as_at_20171003.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;records_as_at_20171004.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;records_as_at_20171005.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;records_as_at_20171006.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;... right the way to ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;records_as_at_20171211.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to do is create running qvd of records that appear in the earliest qvd (in this case 20171001) and only keep those records that are not in the following qvd (20171002).... and place these records in a 'cancellations' qvd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then compare the next two chronological files 20171002 and 20171003 and append those records that exist in 20171002 but not in 20171003 to the 'cancellations qvd.... and so on.... So, at the end of the load process I am left with a running file of cancellations. Could this be incorporated into the your first solution?? Or could this be an addition?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for any help - its very much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2017 09:59:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424616#M429278</guid>
      <dc:creator>prees959</dc:creator>
      <dc:date>2017-12-12T09:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424617#M429279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I've understood correctly, you want your latest record to be retained, and prior records to be put into cancellations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, I would continue loading in reverse date order and add the following flag (substituting in your own key field):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(exists([Key field]), 1, 0) as [Cancellations Flag]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once this is added it should be a simple matter to load cancellations to a new table via a resident load, and save a qvd.&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, 13 Dec 2017 13:18:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424617#M429279</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2017-12-13T13:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424618#M429280</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;Thanks for your reply again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, using your initial solution, would I place the new line of code here :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;for each file in FileList('$(vFolder)DataRun*.xlsx')&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRACE found file $(file);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TempFileList:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subfield('$(file)','\', -1) as tempFileName,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(file)' as tempFullFileName,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; right(subfield(subfield('$(file)','\', -1), '.', 1), &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; as tempFileDate&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AUTOGENERATE 1;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;next file&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;OrderedFileList:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;NOCONCATENATE&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tempFileName as FileName,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tempFullFileName as FullFileName,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tempFileDate as FileDatev2&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;RESIDENT TempFileList&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ORDER BY tempFileDate desc //retrieve most recent files first&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;DROP TABLE TempFileList;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;for n = 1 to NoOfRows('OrderedFileList')&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vCurrentFile = peek('FileName', n-1, 'OrderedFileList');&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vCurrentFileDateStamp = peek('FileDatev2', n-1, 'OrderedFileList');&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRACE ;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRACE $(vCurrentFile);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRACE $(vCurrentFileDateStamp);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [field list],&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;&lt;EM&gt;if(exists([Key field]), 1, 0) as [Cancellations Flag]&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [$(vFolder)$(vCurrentFile)]&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOT Exists(PrimaryKeyField)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;next n&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if not isnull(QvdCreateTime('$(vQVDFolder)Data.QVD')) then&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONCATENATE (Data)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [field list]&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [$(vQVDFolder)Data.QVD]&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOT Exists(PrimaryKeyField)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;end if&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;DROP TABLE OrderedFileList;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Regards, Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Dec 2017 13:28:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424618#M429280</guid>
      <dc:creator>prees959</dc:creator>
      <dc:date>2017-12-14T13:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and Load excel files in a folder in reverse order</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424619#M429281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes, however it looks like in that code there is already a check in the WHERE clause which would prevent any of the Cancellations from being loaded in the first place. So that would have to be removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Dec 2017 14:45:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-and-Load-excel-files-in-a-folder-in-reverse-order/m-p/1424619#M429281</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2017-12-14T14:45:42Z</dc:date>
    </item>
  </channel>
</rss>

