Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mahitham
Contributor

How to generate current and previous date qvds

Hi Experts,

Can any one please help me on below requirement.

I have date field in my data base like below

Date

10/04/2018 00:00:00

11/04/2018 00:00:00

12/04/2018 00:00:00

13/04/2018 00:00:00

14/04/2018 00:00:00

15/04/2018 00:00:00

16/04/2018 00:00:00

17/04/2018 00:00:00


Department:

Load

Date,

Departmentname,

Departmentid,

Salary,

Officeno;


Select

Date,

Departmentname,

Departmentid,

Salary,

Officeno

From  eud.prod;



From the date field how to extract the max and previous dates data into 2 separate qvd's means

need to load 17/04/2018 00:00:00 max date into one qvd named Departmentcurrentdata.qvd and Previousdate i.e,16/04/2018 00:00:00 data into one more qvd named DepartmentPreviousdata.qvd.


While reloading the extraction script based on max and previous date need to generate the qvd dynamically.

Please help me on this.


Thanks in advance

2 Replies
kaanerisen
Contributor III

Re: How to generate current and previous date qvds

Hi Mahitha,


Department:

Load

Date,

Departmentname,

Departmentid,

Salary,

Officeno;


Select

Date,

Departmentname,

Departmentid,

Salary,

Officeno

From  eud.prod;


maxDate:

load max(Date) as maxDate resident Department Group By Date;

Store maxDate into [lib://{{Path}}/Departmentcurrentdata.qvd](qvd);

drop table maxDate;


PerviousDate:

load max(Date,2) as PerviousDate resident Department Group By Date;

Store PreviousDate into [lib://{{Path}}/DepartmentPreviousdata.qvd](qvd);

drop table PreviousDate;


mahitham
Contributor

Re: How to generate current and previous date qvds

Hi,

Thanks for your reply.

I need to store max date i.e., 17/04/2018 00:00:00 date related all the fields data into qvd not only date field.

Thanks in advance.

Community Browser