Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
On a daily basis, a process is run whereby data is imported and saved down into a new .qvd file as FileName_DD-MM-YYYY.qvd. I am looking to add some logic within my Qlik script to only pull back .qvd files that are a month or less old. The files themselves do not have any date information within them but the as of date is saved in the file name and could also be pulled back from the Date Modified info (I am thinking filetime() function).
Please could you let me know how I could limit the historical .qvd files to pull back based on their name/timestamp? At the moment my script which is not working looks like:
Load
Field1,
Field2
From [Filepath\FileName_*.qvd] where filetime([Filepath\FileName_*.qvd]) >= Today()-30;
Any ideas, very appreciated 🙂
Hi,
Try the below script.
Load
Field1,
Field2
From [Filepath\FileName_*.qvd] (qvd) WHERE date(FileTime())>=Today()-30;
Thanks,
Yasmeen
Hi,
Try the below script.
Load
Field1,
Field2
From [Filepath\FileName_*.qvd] (qvd) WHERE date(FileTime())>=Today()-30;
Thanks,
Yasmeen
Thanks very much Yasmeen, that has worked!
One small question, at the moment, the script is still trying to load all files but will not import any data if the date is over 30 days old. Is there a way for the file to simply ignore those other files to help speed up the script part?