Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

yuvaraj_g
New Contributor II

Rolling Seven days based on selection

Hi all,

I have tried to get the rolling seven days based on user selection and below things i have tried. Here the date has mentioned like when the work item has been approved that date only will be entered.

Expression:

Sum({< Date={‘>=$(=Date(Max(Date)-9))<=$(=Date(Max(Date)))’}>} [Number of Approved Items] )


Created variable for based on user selection:

vStartDate - Date(Max(Date)-9))

vEndDate - Date(Max(Date))

Sum({< Date={‘>=$(=Date($(vStartDate))<=$(=Date($(vEndDate))’}>} [Number of Approved Items] )

DateNumber of Approved Items
01-06-20181
02-06-20183
05-06-20182
06-06-20182
07-06-20188
08-06-20184
09-06-20182
10-06-20182
12-06-20182
14-06-20182
15-06-20182
16-06-20182
19-06-20188
21-06-20186
23-06-20183
24-06-20182
26-06-20184
27-06-20185
28-06-20187

Expected Result:

It should be shown the last seven days approved count default

 

19-06-201821-06-201823-06-201824-06-201826-06-201827-06-201828-06-2018
20242525273035

If user select any particular date i want show the result from selection date to last seven days.

For example: user selected date:14-06-2018

then data should be shown from 14-06-2018 to 06-06-2018


Regards,

Yuvaraj

2 Replies
nishanthi_8
Contributor

Re: Rolling Seven days based on selection

What is the issue you are facing? You need to mention double quotes instead of single quotes for any range selection in set analysis.

Arjunarao
Honored Contributor II

Re: Rolling Seven days based on selection

Hi,

Please check this.

Capture.PNG

SET vStartDate ='=Date(Max(Date)-9)';

SET vEndDate ='=Date(Max(Date))';

DATA:

LOAD DATE(DATE#(Date,'DD-MM-YYYY')) as Date,[Number of Approved Items] INLINE [

Date,Number of Approved Items

01-06-2018,1

02-06-2018,3

05-06-2018,2

06-06-2018,2

07-06-2018,8

08-06-2018,4

09-06-2018,2

10-06-2018,2

12-06-2018,2

14-06-2018,2

15-06-2018,2

16-06-2018,2

19-06-2018,8

21-06-2018,6

23-06-2018,3

24-06-2018,2

26-06-2018,4

27-06-2018,5

28-06-2018,7

];