Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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] )
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 |
Expected Result:
It should be shown the last seven days approved count default
19-06-2018 | 21-06-2018 | 23-06-2018 | 24-06-2018 | 26-06-2018 | 27-06-2018 | 28-06-2018 |
20 | 24 | 25 | 25 | 27 | 30 | 35 |
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
What is the issue you are facing? You need to mention double quotes instead of single quotes for any range selection in set analysis.
Hi,
Please check this.
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
];