Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have weekly sales file. one file per week. Every week will have new sales file. they all are qvd format.
What syntax I may use to just load the new created file weekly? Thanks.
check the partial reload in QV help
or in another case use a binary load while concatenating the new file
if you use a standard format for the weekly file naming it could be like
binary test.qvw // has to be first line of the whole script
let vWeekFormat = date(Today(),'YYYYMMDD');
concatenate(Sales)
Load
*
from ../../Sales_'$(vWeekFormat)'.qvd(qvd);
What is the file name format?
You can use 'filetime()' function in the script.
from QlikView online help
Returns the XML-header time stamp from a QVD file if any (otherwise NULL).
The filename is the name of a QVD file, if necessary including path.
Examples:
QvdCreateTime('MyFile.qvd')
QvdCreateTime('C:\MyDir\MyFile.qvd')
Try this
T1:
LOAD
FilePath() as FilePath
,FileTime() as Filetime
FROM
T2:
First 1
Load FilePath as File
Resident T1 Order by Filetime desc
; /// This variable will return Latest file info
Let vFile = Peek('File',0,'T2');
Drop Tables T1,T2;
/// Pass this variable to Qvd load
LatestQVD:
Load *
From
$(vFile)(qvd);
check the partial reload in QV help
or in another case use a binary load while concatenating the new file
if you use a standard format for the weekly file naming it could be like
binary test.qvw // has to be first line of the whole script
let vWeekFormat = date(Today(),'YYYYMMDD');
concatenate(Sales)
Load
*
from ../../Sales_'$(vWeekFormat)'.qvd(qvd);