Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What's the best way?

I have a list box for years (2009 and 2010) and a list box with all of the 12 months. Say the current month is May. The user wants data for all of 2009 and Jan to April for 2010 - No May data for 2010 as the month is not complete and the data is not relevant. So if I select 2009 and 2010 and all of the months except May I will be fine for 2010 but I will be missing May 2009 data.

Whats the best way to solve this? In the script by creating some sort of date flag or with Set Analysis or ????

Thanks,
Stephen

3 Replies
fernandotoledo
Partner - Specialist
Partner - Specialist

There are a lot of ways to do this. I think that if you use two variables, or logic listboxes for month and year, you can make a expression like

sum(if( Year = Year_Logic -1 or Month < Month_Logic, Value)


Not applicable
Author

Hi Stephen,

You can create a new field with Year & Month (Eg: 201005). And In your expression you can put YearMonth < CurrentYearMonth where CurrentYearMonth as Variable.

Regards

Rajesh

Not applicable
Author

Stephen,

One way would be to create a master calendar with the date field being the key field. See this post on creating a master calendar:

http://community.qlik.com/forums/t/22821.aspx


I plan on creating a Share QlikViews file for this pretty soon as well.