<?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: How can i obtain the time of a file in a ftp server in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213252#M711892</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the complete solution. Create a sub with the below code.&lt;/P&gt;&lt;P&gt;/************************************************************/&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUB GetLatestFile(Folder,Mask,OutputVariable)&lt;/P&gt;&lt;P&gt;&amp;nbsp; FOR EACH FoundFile in FileList(Folder &amp;amp; Mask)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FileList:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; SubField('$(FoundFile)','\',-1) AS FileName, FileTime('$(FoundFile)') AS DateTimeStamp&lt;/P&gt;&lt;P&gt;&amp;nbsp; AutoGenerate 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; NEXT FoundFile&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF NoOfRows('FileList') &amp;gt; 0 THEN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; MAX(DateTimeStamp) , FileName&amp;nbsp; AS $(OutputVariable)&lt;/P&gt;&lt;P&gt;&amp;nbsp; RESIDENT FileList&lt;/P&gt;&lt;P&gt;&amp;nbsp; GROUP BY FileName&lt;/P&gt;&lt;P&gt;&amp;nbsp; ORDER BY DateTimeStamp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET $(OutputVariable) = Peek('$(OutputVariable)');&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP TABLES FileList,Variable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDSUB;&lt;/P&gt;&lt;P&gt;/***********************************************************/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And call this in your app &lt;/P&gt;&lt;P&gt;CALL GetLatestFile('$(vFilePath)','*.csv','vMyLastestFile');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps. If this is what you were looking for, please mark this thread as answered. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jul 2014 12:15:56 GMT</pubDate>
    <dc:creator>ChiragPradhan</dc:creator>
    <dc:date>2014-07-11T12:15:56Z</dc:date>
    <item>
      <title>How can i obtain the time of a file in a ftp server</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213247#M711887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I Need to take a csv file from an FTP to integrate on my qlikview model, the problem is that the file is generated every 2 hours with a different name and I need to identify which is the most up to date and take that to my load ... filetime () function returns me null, someone knows if there is another option to get this information?&lt;BR /&gt;&lt;BR /&gt; Thank you very much in advance!&lt;BR /&gt; Gabriela&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 16:11:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213247#M711887</guid>
      <dc:creator />
      <dc:date>2011-02-11T16:11:38Z</dc:date>
    </item>
    <item>
      <title>How can i obtain the time of a file in a ftp server</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213248#M711888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gabriela,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I'm facing with the same problem. Can you share with me the solution if you have solved it? Notice this thread is pretty long ago:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xue Bin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 03:07:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213248#M711888</guid>
      <dc:creator />
      <dc:date>2012-04-25T03:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can i obtain the time of a file in a ftp server</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213249#M711889</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;Have you been able to solve this issue?&lt;/P&gt;&lt;P&gt;If yes, could you share the solution?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 15:11:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213249#M711889</guid>
      <dc:creator />
      <dc:date>2014-07-10T15:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can i obtain the time of a file in a ftp server</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213250#M711890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gabriela,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried using the full file path in the Filetime function rather than just the file name?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 16:11:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213250#M711890</guid>
      <dc:creator>ChiragPradhan</dc:creator>
      <dc:date>2014-07-10T16:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can i obtain the time of a file in a ftp server</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213251#M711891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pradhan,&lt;/P&gt;&lt;P&gt;can you please post an example on how that should look? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 17:39:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213251#M711891</guid>
      <dc:creator />
      <dc:date>2014-07-10T17:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can i obtain the time of a file in a ftp server</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213252#M711892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the complete solution. Create a sub with the below code.&lt;/P&gt;&lt;P&gt;/************************************************************/&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUB GetLatestFile(Folder,Mask,OutputVariable)&lt;/P&gt;&lt;P&gt;&amp;nbsp; FOR EACH FoundFile in FileList(Folder &amp;amp; Mask)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FileList:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; SubField('$(FoundFile)','\',-1) AS FileName, FileTime('$(FoundFile)') AS DateTimeStamp&lt;/P&gt;&lt;P&gt;&amp;nbsp; AutoGenerate 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; NEXT FoundFile&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF NoOfRows('FileList') &amp;gt; 0 THEN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; MAX(DateTimeStamp) , FileName&amp;nbsp; AS $(OutputVariable)&lt;/P&gt;&lt;P&gt;&amp;nbsp; RESIDENT FileList&lt;/P&gt;&lt;P&gt;&amp;nbsp; GROUP BY FileName&lt;/P&gt;&lt;P&gt;&amp;nbsp; ORDER BY DateTimeStamp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET $(OutputVariable) = Peek('$(OutputVariable)');&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP TABLES FileList,Variable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDSUB;&lt;/P&gt;&lt;P&gt;/***********************************************************/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And call this in your app &lt;/P&gt;&lt;P&gt;CALL GetLatestFile('$(vFilePath)','*.csv','vMyLastestFile');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps. If this is what you were looking for, please mark this thread as answered. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 12:15:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213252#M711892</guid>
      <dc:creator>ChiragPradhan</dc:creator>
      <dc:date>2014-07-11T12:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can i obtain the time of a file in a ftp server</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213253#M711893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/108227"&gt;Gabriela Fonseca&lt;/A&gt; Please look at the solution I provided above and mark the question answered if it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 12:31:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-obtain-the-time-of-a-file-in-a-ftp-server/m-p/213253#M711893</guid>
      <dc:creator>ChiragPradhan</dc:creator>
      <dc:date>2014-07-11T12:31:07Z</dc:date>
    </item>
  </channel>
</rss>

