Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys!
How can we read a qvd file to load additional data using read data as filter?
Example:
Loaded a qvd file
max date is 2017-01-01 (how can i know that date)
And, if possible, how can i use that variable in a process to load more dates
Thanks!
Give it a try with
// existing data
Data: LOAD * FROM MyData.QVD (QVD);
// determine highest date
MaxDate: LOAD MAX(MyDate) AS LastDate; LOAD FIELDVALUE('MyDate', RECNO()) AS MyDate AUTOGENERATE FIELDVALUECOUNT('MyDate');
// assign highest date to a variable
LET dMaxDate = NUM(PEEK('LastDate', 0, 'MaxDate'));
DROP TABLE MaxDate;
// add new data to the existing ones
CONCATENATE (Data) LOAD MyDate, ..... FROM ..... WHERE NUM(MyDate) >= $(dMaxDate);
Peter
Use Filetime() function inside the QVD Reader app
Load
FileTime() as FileTime
From Operator.qvd;
This will give you the Filetime.
Hello,
Filetime() returns the date and time of the last modification of the file.
E.g. Load *, filetime() as X from abc.txt ; from QlikHelp
Do you have a date field in your QVD file? Then try this:
MaxDate:
LOAD MAX(ModifiedDate) As LastModifiedDate
FROM XYZ.qvd(qvd);
LET vMaxDate = Peek('ModifiedDate',0,'MaxDate');
After this you can use your vMaxDate variable in your following scripts where necessary.
Give it a try with
// existing data
Data: LOAD * FROM MyData.QVD (QVD);
// determine highest date
MaxDate: LOAD MAX(MyDate) AS LastDate; LOAD FIELDVALUE('MyDate', RECNO()) AS MyDate AUTOGENERATE FIELDVALUECOUNT('MyDate');
// assign highest date to a variable
LET dMaxDate = NUM(PEEK('LastDate', 0, 'MaxDate'));
DROP TABLE MaxDate;
// add new data to the existing ones
CONCATENATE (Data) LOAD MyDate, ..... FROM ..... WHERE NUM(MyDate) >= $(dMaxDate);
Peter