Qlik Community

QlikView Documents

Documents for QlikView related information.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.

Store Qvd file with Timestamp value

Store Qvd file with Timestamp value


//Load Your Table here with proper name given
TableName:
Load * Inline [
Users,ID
A,1
B,2
C,3
]
;

//Create a variable for capture the Timestamp value of the QVW
//with help of NOW() function and give proper Format
Let x = Timestamp(Now(),'YYYY-MM-DD hh.mm.ss TT');

//Store the table into QVD with the help of variable
//which capture the Timestamp value and cancatenate
//it with proper file name with your choice
Store TableName into 'TableName '$(x).qvd(qvd);


Tags (2)
Comments
Not applicable

Good Anand, now only show an example at the end of the document of how to retrieve always the last N days from the directory where all these qvd files reside and that would complete it :-) nice job.

john9inno
Contributor

Not 100% sure. However, I strongly believe combination of 'LET' and Now can allow retrieve latest version.

Thanks Mario,

For reading N days from the stored QVD by use of the vDays variable from the front end defined and we can automate the load script for mentioned days value in the variable suppose last 5 days. Here i can use the date fields for check last days.

Tmp:

LOAD Users,

     ID,

     FileName() as FileName,

     Mid(FileBaseName(),11,Len(FileBaseName())) as [Timestamp Rec],

     Mid(FileBaseName(),11,Len(FileBaseName())-21) as [Date Rec]

FROM

[TableName *.qvd]

(qvd)

Where Mid(FileBaseName(),11,Len(FileBaseName())-21) > Date( (Today() - $(vDays)), 'YYYY-MM-DD' );

TRACE $(vDays);

LET vTrace1 = Date((Today() - $(vDays)), 'YYYY-MM-DD' );

TRACE $(vTrace1);

Regards,

Anand

nikhilgarg
Contributor III

HEy,

I didn't get your above example. Can you please explain the steps that you are trying to do ??

Thanks

Hi,

By the load script table is created and store with table name with timestamp value to fetch which time the QVD is created. After all this i need to load last N days records from this QVD. So i use table name date value for reading date and store into field named [Date Rec] and by the same name i load last 5 days records for for this we check

Where Mid(FileBaseName(),11,Len(FileBaseName())-21) > Date( (Today() - $(vDays)), 'YYYY-MM-DD' );

With variable vDays but the value is pass from the Qlik front end by any input box to the variable.

Regards

Anand

nikhilgarg
Contributor III

Hey,

THankx but i still didn't get you.

What is this function returning ??  Mid(FileBaseName(),11,Len(FileBaseName())-21)

What is FileBaseName() , Mid() and 11 and 21 used ??

What si the value of $(vDays) and Trace() ??

tHanks

sudhir0538
Contributor

hello Anand! Great job really very helpful.

Can u just check this and see if you can help me out ! Badly needs support.

Compare with Old Data

Version history
Revision #:
1 of 1
Last update:
‎11-22-2014 03:06 AM
Updated by: