Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I need last 4 weeks as Dimension Where I am having Week number in my Table .
Hi,
Assuming that you are in week 11 of the current year you could add the below to your script:
DataSet:
load
[Week Number],
if(num([Week Number]) >= week(today())-4, 'Last 4 Weeks') as [Week FLAG]
from YourData;
This should add the flag dynamically as the weeks gradually progress through the year and reload data.
Hi,
If you need to exclude records from the current week then you can add a 'where' statement to the bottom of your script. To change which weeks get flagged we just need to alter the condition in the 'if' statement.
load
[Week Number],
if(num([Week Number]) >= week(today())-6, 'Last 5 Weeks') as [5 Week FLAG]
from YourData
where num([Week Number]) < week(today());
Since you are now dropping week 11 from your data and you want to flag 5 weeks you need to shift it back 6 weeks to get 6,7,8,9,10.
Let me know if you have any other questions.
Thanks
Hi You can try in script
LOAD weekflag
FROM yourLocation
Where Len(Trim(Weekflag)) <> 0;
or
check option supressnull values in dimension
Hi,
Assuming that you are in week 11 of the current year you could add the below to your script:
DataSet:
load
[Week Number],
if(num([Week Number]) >= week(today())-4, 'Last 4 Weeks') as [Week FLAG]
from YourData;
This should add the flag dynamically as the weeks gradually progress through the year and reload data.
Hi,
Thanks For the Reply ...
I need also Like this , My current Week is 11 th Week , I Need Exclude it and display last 5 Weeks as 10,9,8,7,6
Hi,
If you need to exclude records from the current week then you can add a 'where' statement to the bottom of your script. To change which weeks get flagged we just need to alter the condition in the 'if' statement.
load
[Week Number],
if(num([Week Number]) >= week(today())-6, 'Last 5 Weeks') as [5 Week FLAG]
from YourData
where num([Week Number]) < week(today());
Since you are now dropping week 11 from your data and you want to flag 5 weeks you need to shift it back 6 weeks to get 6,7,8,9,10.
Let me know if you have any other questions.
Thanks