Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There,
I have the filename in the below format and I want to only load the file if it belongs to today's date in the folder. If not, then don't load.
FileName:
DataFile_YYYYMMMDD.xlsx
eg- DataFile_2022Mar15.xlsx
Please help
Let vFileName = 'YourPathHere\DataFile_' & date(today(),'YYYYMMDD' & '.xls';
If NOT isnull(FileSize('$(vFileName )') THEN
// Load stuff here
END IF
Have a look at https://community.qlik.com/t5/QlikView-App-Dev/How-can-I-check-if-a-file-exists/td-p/518834 - the rest is just building the correct string for your file path and name.
Let vFileName = 'YourPathHere\DataFile_' & date(today(),'YYYYMMDD' & '.xls';
If NOT isnull(FileSize('$(vFileName )') THEN
// Load stuff here
END IF
Have a look at https://community.qlik.com/t5/QlikView-App-Dev/How-can-I-check-if-a-file-exists/td-p/518834 - the rest is just building the correct string for your file path and name.
Thank you so much for your help. It solves my issue.
Just wondering if the latest file is not available, i want to pick Yesterday's file. How can i add that to the code?
Add an ELSE section to your IF THEN block, set the vFileName to yesterday's file which would be today()-1, and then load that.