Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
lucarizziero
Partner - Contributor III
Partner - Contributor III

Current Year as Set Analysis

Hi all,

I'd like to use a set analysis instruction in order to select current year data.

Something like

sum ( {$<year={2009}>} sales)

instead of

sum(if(year=2009,sales))

but varying the year 2009 to the current year.

Thanks to all.

2 Replies
Not applicable

Sum({$<Year={$(=Year(Today()))}>} Sales)


Some people instead base it on their data:

Sum({$<Year={$(=Max(Year))}>} Sales)


That would pull for the highest year in your data set. For example if you hadn't loaded any new 2010 data yet and wanted to consider 2009 the current year. Sometimes basing it on your data is preferrable to the system date, which is what the first one would get you.

lucarizziero
Partner - Contributor III
Partner - Contributor III
Author

That's perfect: thanks for your courtesy.

Luca