<?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 Load latest csv file in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-latest-csv-file/m-p/1674541#M592982</link>
    <description>&lt;P&gt;I am using the following script to run daily and load the csv file with today's date in the file, I need to know how if there is a day the file is not updated with todays date how i keep the last file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let vToday=date(today(), 'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LOAD [UCS Domain] as 'CAV CS Domain',&lt;BR /&gt;Org as CAVLOB,&lt;BR /&gt;[Host Name] as CAVHostName,&lt;BR /&gt;[Hardware Status] as CAVHardwareStatus,&lt;BR /&gt;[SAN Name] as CAVSANName&lt;BR /&gt;FROM&lt;BR /&gt;[\\cnjxcarlafpd02p.svr\san$\SAN-Fabric-Refresh\VSI-Pending-Reboots\AP-HK-Cavendish\hkcdhvsi.pending-reboots.$(vToday).csv]&lt;BR /&gt;(txt, codepage is 28591, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Feb 2020 19:18:53 GMT</pubDate>
    <dc:creator>tsoley9262</dc:creator>
    <dc:date>2020-02-11T19:18:53Z</dc:date>
    <item>
      <title>Load latest csv file</title>
      <link>https://community.qlik.com/t5/QlikView/Load-latest-csv-file/m-p/1674541#M592982</link>
      <description>&lt;P&gt;I am using the following script to run daily and load the csv file with today's date in the file, I need to know how if there is a day the file is not updated with todays date how i keep the last file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let vToday=date(today(), 'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LOAD [UCS Domain] as 'CAV CS Domain',&lt;BR /&gt;Org as CAVLOB,&lt;BR /&gt;[Host Name] as CAVHostName,&lt;BR /&gt;[Hardware Status] as CAVHardwareStatus,&lt;BR /&gt;[SAN Name] as CAVSANName&lt;BR /&gt;FROM&lt;BR /&gt;[\\cnjxcarlafpd02p.svr\san$\SAN-Fabric-Refresh\VSI-Pending-Reboots\AP-HK-Cavendish\hkcdhvsi.pending-reboots.$(vToday).csv]&lt;BR /&gt;(txt, codepage is 28591, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 19:18:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-latest-csv-file/m-p/1674541#M592982</guid>
      <dc:creator>tsoley9262</dc:creator>
      <dc:date>2020-02-11T19:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Load latest csv file</title>
      <link>https://community.qlik.com/t5/QlikView/Load-latest-csv-file/m-p/1674776#M592983</link>
      <description>&lt;P&gt;Maybe something like:&lt;/P&gt;&lt;P&gt;let vDir = 'Your File Path';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Get latest file name&lt;BR /&gt;Temp:&lt;BR /&gt;load&lt;BR /&gt;FileBaseName() as FileName&lt;BR /&gt;from [$(vDir)\*.csv]&lt;BR /&gt;(txt, codepage is 28591, embedded labels, delimiter is ',', msq);&lt;BR /&gt;&lt;BR /&gt;MaxDate:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;load&lt;BR /&gt;max(FileName) as MaxDate&lt;BR /&gt;resident Temp;&lt;BR /&gt;drop table Temp;&lt;BR /&gt;&lt;BR /&gt;let vFileName = date(peek('MaxDate',-1,'MaxDate'),'YYYY-MM-DD');&lt;BR /&gt;drop table MaxDate;&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;load&lt;BR /&gt;whatever&lt;BR /&gt;from [$(vDir)\$(vFileName).csv]&lt;BR /&gt;(txt, codepage is 28591, embedded labels, delimiter is ',', msq);&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 13:37:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-latest-csv-file/m-p/1674776#M592983</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2020-02-12T13:37:11Z</dc:date>
    </item>
  </channel>
</rss>

