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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

YTD calculation not working

Hi,

I am working on a YTD calculation where I need to calculate it based on the year and month selected by the user.

Though I could get it working by year, it is not working when user select a particular month. This is the expression I am using:

sum({$<Year = {$(=only(Year))}, Month = {"<=$(=max(Month))"}>}SALES_QTY)

Thanks

4 Replies
brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi, arch25

you have to enter a varable:

varMonth: =Max(Month)

and the set analysis looks like this:

Sum({$<Year= {$(=only(Year))}, Month= {"<=$(varMonth)"}>} SALES_QTY)



Not applicable
Author

Hi,

I tried this but it does not resolve the problem.

Thanks

brenner_martina
Partner - Specialist II
Partner - Specialist II

do you have an example?

Not applicable
Author

Hi Martina,

Here's the example file.

Thanks

Archana