Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
rammuthiah
Creator III
Creator III

Load data based on max date

I tried loading data based on max date from file name.

While trying to call in a variable, it's not working.

Is there any way to loa

Capture.JPG

13 Replies
agigliotti
MVP
MVP

could you provide a sample app with mock data ?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
agigliotti
MVP
MVP

set vMaxDate = 0;

FOR Each File in filelist ('.\your_path\*.xlsx')

     set vFileNameDate = date#(left(FileBaseName(), 10),'YYYY-MM-DD');

     set vFileNameNumDate = num( replace( vFileNameDate, '-', '') );


     if $(vFileNameNumDate) > $(vMaxDate) then

          set vMaxDate = $(vFileNameNumDate);

          set vFileNameMax = FileBaseName();

     end if

 

NEXT File;

// finally load your last excel file

LOAD

...

from '$(vFileNameMax)'

(ooxml, embedded labels, table is Sheet1);

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
rammuthiah
Creator III
Creator III
Author

For loop works fine for me

rammuthiah
Creator III
Creator III
Author

For loop works well. Thanks for your hint