<?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: Load file whose name has a date that changes everyday in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002752#M969571</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14429347726089575 jive_text_macro" jivemacro_uid="_14429347726089575"&gt;
&lt;P&gt;FileName:&lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date#(TextBetween(FileName(),'_','.'),'YYYYMMDD') as FileDate&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;*.csv&lt;/P&gt;
&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Date:&lt;/P&gt;
&lt;P&gt;Load Max(FileDate) as MaxFileDate Resident FileName;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table FileName;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Let vMaxDate = Date(Peek('MaxFileDate',0,'Date'),'YYYYMMDD');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table Date;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FinalTable:&lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;file_$(vMaxDate).csv&lt;/P&gt;
&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above script will first find the file having maximum date as name and load it..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Sep 2015 15:12:30 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2015-09-22T15:12:30Z</dc:date>
    <item>
      <title>Load file whose name has a date that changes everyday</title>
      <link>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002749#M969568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every night, an updated file is uploaded. It has a name like file_20150922.csv&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (file_YYYYMMDD.csv) with the date of yesterday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want my application to point on the last version of the file eg. today, my file will point on file_20150921.csv but tomorrow, it will have to point on file_20150922.csv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp;&amp;nbsp; file_20150922.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I do something like:&lt;/P&gt;&lt;P&gt;From file_Today()-1&amp;nbsp; ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 15:04:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002749#M969568</guid>
      <dc:creator />
      <dc:date>2015-09-22T15:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Load file whose name has a date that changes everyday</title>
      <link>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002750#M969569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can use something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set vDataLoad = Date(Today(),'YYYYMMDD');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;From file_$(vDataPath).csv;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 15:08:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002750#M969569</guid>
      <dc:creator />
      <dc:date>2015-09-22T15:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Load file whose name has a date that changes everyday</title>
      <link>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002751#M969570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use a variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WeekYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()) &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()),'00') &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Day&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()),'00'); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Load .... Resident File_$(vDate).csv;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Let me know&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 15:09:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002751#M969570</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2015-09-22T15:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Load file whose name has a date that changes everyday</title>
      <link>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002752#M969571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14429347726089575 jive_text_macro" jivemacro_uid="_14429347726089575"&gt;
&lt;P&gt;FileName:&lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date#(TextBetween(FileName(),'_','.'),'YYYYMMDD') as FileDate&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;*.csv&lt;/P&gt;
&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Date:&lt;/P&gt;
&lt;P&gt;Load Max(FileDate) as MaxFileDate Resident FileName;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table FileName;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Let vMaxDate = Date(Peek('MaxFileDate',0,'Date'),'YYYYMMDD');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table Date;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FinalTable:&lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;file_$(vMaxDate).csv&lt;/P&gt;
&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above script will first find the file having maximum date as name and load it..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 15:12:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002752#M969571</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-09-22T15:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Load file whose name has a date that changes everyday</title>
      <link>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002753#M969572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you should use in your&amp;nbsp; script&amp;nbsp; &lt;/P&gt;&lt;P&gt;LET vDate= date(today()-1,'YYYYMMDD'); &lt;/P&gt;&lt;P&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;Load&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&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&amp;nbsp;&amp;nbsp; file_$(vDate).csv&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&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 17:08:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002753#M969572</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-22T17:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Load file whose name has a date that changes everyday</title>
      <link>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002754#M969573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am currently doing something exactly like that, so as long as each day, the file layout is exactly the same, and only the data chnges, and the files are in the same directory, you can use a wild card in your file name&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; [..\AB_*_Report.xlsx]&lt;BR /&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ooxml&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;embedded&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;labels&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Flash_Report); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;based on my naming convention the data bewteen the '_', which is where the wild card is, is a date.&amp;nbsp; As long as the file is put in the directory with that naming convention the reload picks it up&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 17:15:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-file-whose-name-has-a-date-that-changes-everyday/m-p/1002754#M969573</guid>
      <dc:creator />
      <dc:date>2015-09-22T17:15:41Z</dc:date>
    </item>
  </channel>
</rss>

