<?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: Max Date from Files Name in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Max-Date-from-Files-Name/m-p/1776701#M60219</link>
    <description>&lt;P&gt;The list appears to return in sorted order, so if you change the vMaxDate definition to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FOR EACH vFile in FileList('lib://Path\DATA_*.qvd')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LET vDateMax = Right(SubField(vFile, '.', 1), 6);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NEXT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you should end up with the most recent YYYYMM.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jan 2021 11:47:37 GMT</pubDate>
    <dc:creator>GaryGiles</dc:creator>
    <dc:date>2021-01-22T11:47:37Z</dc:date>
    <item>
      <title>Max Date from Files Name</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Date-from-Files-Name/m-p/1775538#M60106</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I would like a little help for this case :&lt;/P&gt;&lt;P&gt;I load a bunch of QVD files in my app. Those QVD files are named DATA_YYYYMM (ex : DATA_202010).&lt;/P&gt;&lt;P&gt;Until now, to load only a specific historic, I used this in the script :&lt;/P&gt;&lt;P&gt;LET vDateMin = Date(ADDMONTHS(Today(),-3),'YYYYMM');&lt;BR /&gt;LET vDateMax =Date(ADDMONTHS(Today(),-1),'YYYYMM');&lt;/P&gt;&lt;P&gt;FOR i = $(vDateMin) to $(vDateMax)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;IF RIGHT(i,2) = 13 THEN&lt;BR /&gt;i = LEFT(i,4) + 1&amp;amp;01&lt;BR /&gt;END IF ;&lt;/P&gt;&lt;P&gt;(note : this part is only to handle the end of a year)&lt;/P&gt;&lt;P&gt;LET vFilePath='lib://Path\DATA_$(i).qvd';&lt;/P&gt;&lt;P&gt;TABLE :&lt;BR /&gt;LOAD&lt;BR /&gt;*&lt;BR /&gt;FROM&lt;BR /&gt;'$(vFilePath)'&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;NEXT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to do now is to let vDateMin as it is, but to have for vDateMax the date of the last file created in the repertory, with the most recent YYYYMM.&lt;/P&gt;&lt;P&gt;I tried this :&lt;/P&gt;&lt;P&gt;FOR EACH vFile in FileList('lib://Path\DATA_*.qvd')&lt;BR /&gt;LET vDateMax = Max(Right(SubField(vFile, '.', 1), 6));&lt;/P&gt;&lt;P&gt;But no value appears, and the script ends in error.&lt;/P&gt;&lt;P&gt;Can you help ?&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Martin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 11:03:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Date-from-Files-Name/m-p/1775538#M60106</guid>
      <dc:creator>Martin22</dc:creator>
      <dc:date>2021-01-19T11:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date from Files Name</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Date-from-Files-Name/m-p/1776701#M60219</link>
      <description>&lt;P&gt;The list appears to return in sorted order, so if you change the vMaxDate definition to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FOR EACH vFile in FileList('lib://Path\DATA_*.qvd')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LET vDateMax = Right(SubField(vFile, '.', 1), 6);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NEXT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you should end up with the most recent YYYYMM.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 11:47:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Date-from-Files-Name/m-p/1776701#M60219</guid>
      <dc:creator>GaryGiles</dc:creator>
      <dc:date>2021-01-22T11:47:37Z</dc:date>
    </item>
  </channel>
</rss>

