Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
BlondeThursday
Contributor III
Contributor III

Add season to Master Calendar

I have a "standard" Master Calendar. I need to add a selector to select the months making up two seasons.

The seasons are Summer = May through October and Winter = November through April.

How can I set the Winter season to start in November of the year selected and select through the following April?

So, the user will select the start year (say 2018) and the season.

If they select Winter they will see data for Nov 2018 through April 2019. If they select Summer they will see data for May 2018 through October 2018.

What is the best way to accomplish this?

Labels (4)
1 Solution

Accepted Solutions
BlondeThursday
Contributor III
Contributor III
Author

I think I can get there using variables for the start and end of each season, and making different versions of every chart to show a winter version and a summer version, but it would still be nice to have a selector (button?) that would just change the dates selected.

View solution in original post

5 Replies
miskinmaz
Creator III
Creator III

in your master calendar script try to add the flag where you will use the condition like:

if(month> Nov and month < april , 'Winter','Summer') as Season

Note: I have just jolted down the algorithm, need to add proper function and field for the requirement. 

BlondeThursday
Contributor III
Contributor III
Author

Thank you, but that gets me Nov, Dec, Jan, Feb, Mar, and Apr in the same year. I need from Nov of the selected year through Apr of the following year.

miskinmaz
Creator III
Creator III

Try this 

Load 

Month,

....

from MasterCalendar

left join

Load * Inline [

Month,Season

Nov, Winter

Dec,Winter

....

June,Summer,

...

];

the only con is that this method is not dynamic.

BlondeThursday
Contributor III
Contributor III
Author

I think I can get there using variables for the start and end of each season, and making different versions of every chart to show a winter version and a summer version, but it would still be nice to have a selector (button?) that would just change the dates selected.

miskinmaz
Creator III
Creator III

It is easy to manipulate date when we are creating the field at script.

Further to the script code you can always use the button and on button click you can use the trigger to select the respective season, this in turn will change the date.