<?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 Loading the latest excel file from a folder into Qlik Sense Desktop in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Loading-the-latest-excel-file-from-a-folder-into-Qlik-Sense/m-p/1602796#M4176</link>
    <description>&lt;P&gt;I needed to load the latest file from a shared folder into Qlik Sense desktop, while filtering out certain data during the load process on a daily basis.&lt;/P&gt;&lt;P&gt;The tricky part was that the file would always have a time extension along with the date, i.e. filename_yyyymmdd_hhmmss.xlsx and is &amp;gt; 150mb each.&lt;/P&gt;&lt;P&gt;I've seen a number of very useful posts here in the community, however all of them suggested to iterate through each file, which given their size made it pretty much unusable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope my solution may be useful to anyone facing a similar problem.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Load FileName() as File_Name,&lt;/P&gt;&lt;P&gt;Date(Left(Right(FileName(), 20), 8), 'YYYYMMDD') as DateField&lt;/P&gt;&lt;P&gt;FROM [lib://KPI 4/Table*.xlsx];&lt;BR /&gt;//(ooxml, embedded labels, table is Table);&lt;/P&gt;&lt;P&gt;Min_Max:&lt;BR /&gt;Load Max(DateField) as MaxDate,&lt;BR /&gt;Min(DateField) as MinDate&lt;BR /&gt;Resident Table;&lt;/P&gt;&lt;P&gt;Let vMaxDate=PEEK('MaxDate',0,'Min_Max');&lt;/P&gt;&lt;P&gt;Drop table Table;&lt;/P&gt;&lt;P&gt;//this part iterates over the file names in the folder and picks the latest date&lt;/P&gt;&lt;P&gt;Table:&lt;BR /&gt;Load *&lt;/P&gt;&lt;P&gt;FROM [lib://KPI 4/Table_$(vMaxDate)_*.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Table)&lt;BR /&gt;where not WildMatch([Account Book], 'US*');&lt;/P&gt;</description>
    <pubDate>Tue, 28 Dec 2021 20:22:49 GMT</pubDate>
    <dc:creator>a_krakovskyi</dc:creator>
    <dc:date>2021-12-28T20:22:49Z</dc:date>
    <item>
      <title>Loading the latest excel file from a folder into Qlik Sense Desktop</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Loading-the-latest-excel-file-from-a-folder-into-Qlik-Sense/m-p/1602796#M4176</link>
      <description>&lt;P&gt;I needed to load the latest file from a shared folder into Qlik Sense desktop, while filtering out certain data during the load process on a daily basis.&lt;/P&gt;&lt;P&gt;The tricky part was that the file would always have a time extension along with the date, i.e. filename_yyyymmdd_hhmmss.xlsx and is &amp;gt; 150mb each.&lt;/P&gt;&lt;P&gt;I've seen a number of very useful posts here in the community, however all of them suggested to iterate through each file, which given their size made it pretty much unusable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope my solution may be useful to anyone facing a similar problem.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Load FileName() as File_Name,&lt;/P&gt;&lt;P&gt;Date(Left(Right(FileName(), 20), 8), 'YYYYMMDD') as DateField&lt;/P&gt;&lt;P&gt;FROM [lib://KPI 4/Table*.xlsx];&lt;BR /&gt;//(ooxml, embedded labels, table is Table);&lt;/P&gt;&lt;P&gt;Min_Max:&lt;BR /&gt;Load Max(DateField) as MaxDate,&lt;BR /&gt;Min(DateField) as MinDate&lt;BR /&gt;Resident Table;&lt;/P&gt;&lt;P&gt;Let vMaxDate=PEEK('MaxDate',0,'Min_Max');&lt;/P&gt;&lt;P&gt;Drop table Table;&lt;/P&gt;&lt;P&gt;//this part iterates over the file names in the folder and picks the latest date&lt;/P&gt;&lt;P&gt;Table:&lt;BR /&gt;Load *&lt;/P&gt;&lt;P&gt;FROM [lib://KPI 4/Table_$(vMaxDate)_*.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Table)&lt;BR /&gt;where not WildMatch([Account Book], 'US*');&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 20:22:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Loading-the-latest-excel-file-from-a-folder-into-Qlik-Sense/m-p/1602796#M4176</guid>
      <dc:creator>a_krakovskyi</dc:creator>
      <dc:date>2021-12-28T20:22:49Z</dc:date>
    </item>
  </channel>
</rss>

