Discussion Board for collaboration on QlikView Scripting.
I'm trying to load all qvds in the given folder which have timestamp greater than the date i give:
If my date given is 20160915, then i wanna load all qvds greater than 20160915 (this is the time stamp in the last 8 characters of the filename).
Any help is highly appreciated.
Go to Solution.
Still have to run a test on this, but you'll get the idea:
LET vPath = 'C:\Temp\';
LET vCutoffDate = '20160915';
LET vCutoffNum = num(MakeDate(left(vCutoffDate, 4), mid(vCutoffDate, 5, 2), right(vCutoffDate, 2)));
FOR EACH vFilePath in FileList('$(vPath)\*.QVD')
LET vFileDate = right(mid(vFilePath, index(vFilePath, '\', -1)+1,
index(vFilePath, '.', -1) - index(vFilePath, '\', -1) -1), 8);
IF (len(vFileDate) = 8) and (len(Purgechar(vFileDate, '0123456789')) = 0) THEN
IF MakeDate(left(vFileDate, 4), mid(vFileDate, 5, 2), right(vFileDate, 2)) > vCutoffNum THEN
LOAD * FROM [$(vFilePath)] (qvd);
[Edit] Made a few corrections to make it work allright
Do these QVDs have the same layout, e.g. should they be concatenated into the same Resident table?
Yes sir. This is for concatenation into the resident table.