Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ishanbansal1204
Contributor III
Contributor III

YTD In qlik sense

i am working on YTD calculation and i have week and year as a parameter.

Sum({1 <WEEK={">}WEEK))<=$(=Max({<Year={$(=MAX(Year))}>}WEEK))"}, Year = {$(=MAX(Year))}>}M_COUNT_WEEK)

when i am using the above query its always fetching me the max of year. ideally it should give me the data for the year that i am selecting. i have 2 years 2016 and 2015 when i am selecting 2015 it still shows me 2016 data. please help.

11 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

This is not too difficult if your calender has a week sequence number, because week 52/3 of the previous year would have a sequence number 1 less than week 1 of the current year. Without a sequence number, it gets more difficult. Both of these are rather dependent on how you handle the partial week at the start and end of the year.

I suggest that you start a new thread to ask this question and for assistance in adding a week sequence number. You can always add a link back to this original question if needed.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
ishanbansal1204
Contributor III
Contributor III
Author

I will do that. Thanks Jonathan