Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have data from Week 48 of 2019 to week 9 of 2020. I need to display YTD sales by selecting Weeks filter.
My Week Number filter shows from week 1 to 9 and 48 to 52 (1,2,3,4,5,6,7,8,9,48,49,50,51,52) like above. when I tries to calculate YTD it calculates from Week 1 not from Week 48.
I need it to show like - (48,49,50,51,52,1,2,3,4,5,6,7,8,9) and YTD from Week 48.
Can somebody help me on this.
Good morning,
I think you should add one more filter in your set analysis that defines the year, and also to do this kind of calculation you need to add new column in your script which is : YearWeek
LOAD
Year&Week as YearWeek
FROM x
And the filter in your UI has to be the YearWeek to define which year .
In your set analysis :
Sum({<Year={"$(=max({<WeekYear={'$(max(YearWeek))'}>}Year))"}>}Sales)
This set analysis will select the year of the the wanted week
Thanks a lot it working fine. but When it comes to week 53 it taking 202153 and 202053 (i.e same week considering twice).