Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
Can any one please help me on below requirement.
I've data for 24 months but by default the user wants to see the data for 6 months and for the rest of the months he want's to see it using the filter.
I've s_month as the field.
@sunny_talwar @anil @Anil_Babu_Samineni @Kushal_Chawda @vaibhavv @anu @Sash
Let me understand you further - in case of no user selection - you want the present the last 6 month. If the user select one month, you want to present only this month data, or the selected month + previous 5 month prior to it, or just the selected month alone?
hi,
try this link
https://community.qlik.com/t5/Qlik-Sense-App-Development/QlikSense-Default-Month-Filter/td-p/1140625
ksrinivasan
It should be just the selected month alone.
Instead of writing the expression in every charts and KPI, is there any other work around?
You can create a master measure and use it in all the charts an KPIs, thus you would need to write the expression only once.
Hi Sonkumamon,
Could you please help me to write the expression please.
Let's assume the month field is 's_month' , and filed 'Sales' is the measure.
Thanks so much in advance.
1) Create bookmark for selected one and it allows by default if you are using latest version in QS
2) Perhaps you can play around Only({<s_month = E(s_month)>}s_month)
hi,
try this link
ksrinivasan
Hi Prakash,
Lets say you want to calculate the measure only for the selected month, then your expression should be something like this:
Sum({<s_month={$(=Max(s_month)}>} Sales)
Lets say you want to calculate the measure for the last 6 month when there is no selection, your expression should be like:
Sum({<s_month={">=AddMonths(Max(s_month),-6)<=Max(s_month)"}>} Sales)
So, if you want to make this expression dynamic (shows the last 6 month if no month is selected, and only the selected month in case of a selection, you should either use this 2 measures and each time hide one of then is concern of the selection, or create one dynamic measure:
Sum({<s_month=If(GetSelectedCount(s_month)=0,{">=AddMonths(Max(s_month),-6)<=Max(s_month)"},Max(s_month)) >} Sales)
Keep in mind that using the above expression may effect the performance as it uses an if expression for in a measure.
Uri