<?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: Only load latest file in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671645#M673430</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this is helpful: &lt;A href="https://community.qlik.com/message/881986"&gt;Re: Pick the latest excel file from folders&lt;/A&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>Fri, 18 Dec 2015 10:40:27 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2015-12-18T10:40:27Z</dc:date>
    <item>
      <title>Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671636#M673418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the script below for incremental loading of files copied out to a shared drive and it works great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to change this code to only load the latest file for another application I am working on.&amp;nbsp; Any suggestions how I can determine which file is the most recent?&amp;nbsp; I did not write this code, I got this from the community some time back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Creates current table&amp;nbsp; of excel files in the directory for incremental loading to compare to existing&lt;/P&gt;&lt;P&gt; TRACE DoDir; &lt;/P&gt;&lt;P&gt;SUB DoDir (Root)&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FOR Each File in FileList(Root&amp;amp;'$(vSourceFile)')&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Files:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD '$(File)' as File_Name &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoGenerate 1;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; NEXT File&amp;nbsp; &lt;/P&gt;&lt;P&gt;ENDSUB&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL DoDir (vRoot)&amp;nbsp; &lt;/P&gt;&lt;P&gt; Trace Loop; &lt;/P&gt;&lt;P&gt;FOR i=0 to NoOfRows('Files')-1&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; LET vFileName = Peek('File_Name', 0, 'Files');&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF Date(Date#(SubField(vFileName, '_', 4), 'DD-MMM-YYYY')) &amp;gt;= vDateFrom and Date(Date#(SubField(vFileName, '_', 5), 'DD-MMM-YYYY')) &amp;lt;= vDateTo then&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AppExtracts:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD *&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; From [$(vRoot)\$(vFileName)] ;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ENDIF&amp;nbsp; &lt;/P&gt;&lt;P&gt;NEXT i;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 14:54:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671636#M673418</guid>
      <dc:creator />
      <dc:date>2014-08-28T14:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671637#M673420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can use the filetime function to determine the latest one :&lt;/P&gt;&lt;P class="MCDropDownHead_syntax_0"&gt;&lt;A class="MCDropDownHotSpot_0" name="filetime"&gt;&lt;IMG class="MCDropDownIcon jiveImage" style="margin-right: 5px; border-style: none;" /&gt;&lt;SPAN class="Bold"&gt;filetime(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;[ filename ]&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Returns a timestamp for the date and time of the last modification of the file &lt;SPAN class="Italic"&gt;filename&lt;/SPAN&gt;. If no &lt;SPAN class="Italic"&gt;filename&lt;/SPAN&gt; is specified, the function will refer to the currently read table file. &lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P class="Code"&gt;filetime( 'xyz.xls' )&lt;/P&gt;&lt;P&gt;Will return the timestamp of the last modification of the file xyz.xls. &lt;/P&gt;&lt;P class="Code"&gt;Load *, filetime() as X from abc.txt ;&lt;/P&gt;&lt;P&gt;Will return the date and time of the last modification of the file (abc.txt) as a timestamp in field X in each record read. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 15:02:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671637#M673420</guid>
      <dc:creator>giakoum</dc:creator>
      <dc:date>2014-08-28T15:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671638#M673423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could add filetime() and and use a second load with a sorting-order and use the first or last row or a max-statement about the filetime:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;Files:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD '$(File)' as File_Name, filetime('$(File)') as FileTime&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoGenerate 1;&amp;nbsp; &lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MaxTime:&lt;/P&gt;&lt;P&gt;Load File_Name, max(FileTime) as MaxFileTime Resident Files Group By File_Name;&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>Thu, 28 Aug 2014 15:05:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671638#M673423</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-08-28T15:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671639#M673424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you!&amp;nbsp; I will try that and use it to sort and use peek function to get last file, will that work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 15:23:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671639#M673424</guid>
      <dc:creator />
      <dc:date>2014-08-28T15:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671640#M673425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, or top 1 if you order the results correctly &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 15:26:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671640#M673425</guid>
      <dc:creator>giakoum</dc:creator>
      <dc:date>2014-08-28T15:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671641#M673426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&amp;nbsp; this helped but I only want to load the one record with the latest date not all the files.&amp;nbsp; I can order desc by file date then pull in only the first record I believe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 16:26:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671641#M673426</guid>
      <dc:creator />
      <dc:date>2014-08-28T16:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671642#M673427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;load top 1 filename&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;order by filetime desc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 20:10:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671642#M673427</guid>
      <dc:creator>giakoum</dc:creator>
      <dc:date>2014-08-28T20:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671643#M673428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for suggestions. In the end, I convinced them to just save the latest file so we don’t have to worry about this script.  But I was able to successfully create the logic to load the last file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 17:38:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671643#M673428</guid>
      <dc:creator />
      <dc:date>2014-09-02T17:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671644#M673429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you attach script for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vikas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 10:31:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671644#M673429</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2015-12-18T10:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671645#M673430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this is helpful: &lt;A href="https://community.qlik.com/message/881986"&gt;Re: Pick the latest excel file from folders&lt;/A&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>Fri, 18 Dec 2015 10:40:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671645#M673430</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-12-18T10:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671646#M673431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcus&lt;/P&gt;&lt;P&gt;Please can you go through my thread &lt;A href="https://community.qlik.com/thread/197094"&gt;Load excel files dynamic and check whether excel file is changed or modify if yes load into qvd&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Whether I can use this script for my purpose.&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;Vikas &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 10:45:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671646#M673431</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2015-12-18T10:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Only load latest file</title>
      <link>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671647#M673432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you each xls stores as qvd then will be the suggestion from &lt;A href="https://community.qlik.com/qlik-users/3540"&gt;pcammaert&lt;/A&gt; suitable. If you stores all xls in one qvd then you need to store the filenames and filetimes within these qvd. You will need in both cases a loop through your folders/files and checking these parameter to skip the files if they are unchanged or to drop and load again these data/files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 11:35:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-load-latest-file/m-p/671647#M673432</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-12-18T11:35:43Z</dc:date>
    </item>
  </channel>
</rss>

