You could use an 'large' formula with 'if' selected = Year, then... etc. But it that works (as you have months and years with different amount of days).
The alternative state is perhaps usefull (Qlik Sense Alternate States - The Full Set - YouTube).
Or take a look a Qlik Branch (Qlik Branch), such as: http://branch.qlik.com/#!/project/56728f52d1e497241ae698a0
In order to achieve what you described, you need to have a table in your dataset, with all possible Date dimensions in one field, and the corresponding Set Analysis filters in the other field. Let's call these fields DateDim and DateDimFilter
Then, you should have two variables that store the current values of the two fields:
vDateDim = '=only(DateDim)'
vDateDimFilter = '=only(DateDimFilter)'
In your chart, the Chart dimension should be:
and the chart Measure should read:
that should do the trick.
Learn advanced QlikView and Qlik Sense techniques in my book QlikView Your Business
Here is a working example of a solution you could possibly use.
It uses the QSVariable extension to create the button to populate the variable and you can see in the chat the logic to change, titles, dimensions and measures.
Hope this helps.
Cyclic Group.qvf 176.0 K
Button is only showing Month bcz you passed 3 into variable while creating and no selection is working on Button.
any solution, If button click can work..