Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
tyagishaila
Specialist
Specialist

Datewise QVD

Hi All,

Is there any possibility, we can get previous date data ?

means suppose I created a qvd on 7th Apr but on 9th Apr can we check 7th Apr qvd data.

(Date is not any field in my database)

I think it can be possible if I save daily created qvds with different name.. and when we need previous date data we access that qvd.

it is just an idea which I think, Can it be done automatic?

All replies are valuable

Thanks

8 Replies
Colin-Albert
Partner - Champion
Partner - Champion

Do you have separate QVD files for each date?

If so you can use the QvdCreateTime() function in your load script.

load   

QvdCreateTime('C:\MyDir\MyFile.qvd') as Created,

.....

from 'C:\MyDir\MyFile.qvd' (qvd) ;

Can you add a date field in your data that you can include in the script that generates the QVD?

Can you reload the data for previous dates with a date field?

tyagishaila
Specialist
Specialist
Author

Thanks Colin,

I dont have separate qvd files.

I have to save qvds daily with different names.

And I also can't add Date field in my database.

Anonymous
Not applicable

Hi,

Create a variable with the date and the name of your QVD you add the name of the variable, example: the name of your QVD  will  be

09/ 04 / 2015_NameQVD.qvd

----------------------------------------------

Let vDate = date(today(),'DD/MM/YYYY'); // Create a variable

NameTable: 

Load

     *

....

from NameTale

;

STORE * FROM NameTable INTO  $(vDate)_NameQVD.QVD;

DROP TABLE [NameTable ];

maxgro
MVP
MVP

// yesterday

let date=date(Today()-1, 'YYYYMMDD');

table: load rowno() as field autogenerate 100;

STORE table into table_$(date).qvd (qvd);

DROP Table table;

// today, read yesterday qvd

let date_1=date(Today()-1, 'YYYYMMDD');

table: load * from table_$(date_1).qvd (qvd);

tyagishaila
Specialist
Specialist
Author

Thanks Santos,

If I will create vDate variable with today() then this today() will change daily with today date.

I want daily create a new qvd. so that we can use previous qvd to analyse previous result any time.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Check this script for saving and reading data

// To save todays data to QVD

LET vToday = Date(Today(), 'YYYYMMDD');

Data:

Load

*

FROM DataSource;

STORE Data Into Data_$(vToday).qvd(qvd);

DROP Table table;

// To read yesterdays data

LET vYesterday = Date(Today() - 1, 'YYYYMMDD');

Data:

Load *

FROM Data_$(vYesterday).qvd (qvd);

Regards,

Jagan.

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Hi,

Try this :

load  

QvdCreateTime(path\QvdName) as New,

.....

from ...... ;

Regards,

Nagarjuna

Anonymous
Not applicable

Is it right every time it runs used the current date, if it runs at different times of day you can add time  for  distinguish from one another.

Let vDate =date( now() , 'DD/MM/YYYY hh:mm:ss'); // Create a variable

NameTable:

Load

     *

....

from NameTale

;

STORE * FROM NameTable INTO  $(vDate)_NameQVD.QVD;

DROP TABLE [NameTable ];