Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Saro_2306
Contributor II
Contributor II

Fiscal Year

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.

2 Replies
yassinemhadhbi
Creator II
Creator II

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

Best Regards
Yassine Mhadhbi
Saro_2306
Contributor II
Contributor II
Author

Thanks a lot it working fine. but When it comes to week 53 it taking 202153 and 202053 (i.e same week considering twice).