<?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 Select Only the latest file from the Azure storage data connection in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Select-Only-the-latest-file-from-the-Azure-storage-data/m-p/2429539#M20177</link>
    <description>&lt;P&gt;I want to automatically fetch only the first file into qlik sense from this path. How can do that? There is a date column in that excel file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kartik2_0-1710217007831.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/161755iA353C1EF968C5CAE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kartik2_0-1710217007831.png" alt="Kartik2_0-1710217007831.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2024 04:18:52 GMT</pubDate>
    <dc:creator>Kartik2</dc:creator>
    <dc:date>2024-03-12T04:18:52Z</dc:date>
    <item>
      <title>Select Only the latest file from the Azure storage data connection</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Select-Only-the-latest-file-from-the-Azure-storage-data/m-p/2429539#M20177</link>
      <description>&lt;P&gt;I want to automatically fetch only the first file into qlik sense from this path. How can do that? There is a date column in that excel file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kartik2_0-1710217007831.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/161755iA353C1EF968C5CAE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kartik2_0-1710217007831.png" alt="Kartik2_0-1710217007831.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 04:18:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Select-Only-the-latest-file-from-the-Azure-storage-data/m-p/2429539#M20177</guid>
      <dc:creator>Kartik2</dc:creator>
      <dc:date>2024-03-12T04:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select Only the latest file from the Azure storage data connection</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Select-Only-the-latest-file-from-the-Azure-storage-data/m-p/2429957#M20186</link>
      <description>&lt;P&gt;Example logic (we need to use the Azure Storage Metadata Connector):&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;LIB CONNECT TO 'Azure_Storage_Metadata';
// Get a list of files, you will likely want to filter on prefix
[list_of_files]:
LOAD 
	Name as [file_name], 
	[Creation-Time] as [file_time_created], 
	[Last-Modified] as [file_time_modified];

SELECT Name,
	[Creation-Time],
	[Last-Modified]
FROM ListBlobs
WITH PROPERTIES (
prefix='',
includeUncommitted='false',
maxResults=''
);

// Get most recent file, we are ordering by the file_time_created field in order to ensure sort order for the later variable
[most_recent_file_list]:
NoConcatenate
LOAD
	[file_name],
    [file_time_created] AS [file_time_created],
    [file_time_modified] AS [file_time_modified]
RESIDENT [list_of_files]
ORDER BY [file_time_created] DESC;

// Drop initial load
DROP TABLE [list_of_files];

// Select first record in the sorted file list
LET v_file = Peek('file_name',0,'most_recent_file_list');

// Load the file, your load logic will need to be adjusted to reflect the schema of your file
[data]:
LOAD
    *
FROM [lib://Azure_Storage/$(v_file)] (txt, codepage is 28591, embedded labels, delimiter is ',', msq);

DROP TABLE [most_recent_file_list];&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Mar 2024 16:38:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Select-Only-the-latest-file-from-the-Azure-storage-data/m-p/2429957#M20186</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2024-03-12T16:38:10Z</dc:date>
    </item>
  </channel>
</rss>

