Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to know qvd file max date

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!

1 Solution

Accepted Solutions
prieper
Master II
Master II

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

View solution in original post

4 Replies
its_anandrjs

Use Filetime() function inside the QVD Reader app

Load

FileTime() as FileTime

From Operator.qvd;

This will give you the Filetime.

andrei_delta
Partner - Creator III
Partner - Creator III

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

vishsaggi
Champion III
Champion III

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.

prieper
Master II
Master II

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