Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I would like to use buttons as filters to filter my bar chart.
For example, when I select the button 'Events', the bar chart will show me the Events by year month.
So I guess the button should be able to change the measure of the bar chart dynamically based on the selection.
I am not able to use any extensions. so this has to be done by writing expressions and setting up the button.
Could you please help?
This solved my question https://help.qlik.com/en-US/video/gMeaNp21JJo
Rather than using a button, consider using a field (filter pane). Either way, set up a variable (mine is called vFieldSelection) which sets up a formula attached to the value or button, for example:
if(myField = 'Sales', 'Sum(Sales)', 'Sum(Quantity)')
This would have a list of your measures. You would then create a measure:
=['$(vFieldSelection)']
If you prefer to use a button you'd just need to use the button to set the variable values, but the same concept will apply.
Hello Pal,
to achieve you requirement we need to just follow below steps:
i am assuming Dimension as YearMonth field
-> create a variable vSwitch assign value 'event'
-> In your created button add action to set value in variable
-> create two measure in bar chart
Now in measure both the measure go the calculation condition
In event measure calc. condition , put $(vSwitch)='event'
In new buyer measure calc. condition, put $(vSwitch)='new buyer'
done!
you are good to go.
Hi @satish3922
Thanks for your help, but I don't understand this
-> create two measure in the bar chart
--- I do not have a field called event or new buyer, they are the name of my measures.
This solved my question https://help.qlik.com/en-US/video/gMeaNp21JJo
Hi @q11hhg
you can use your show condition in your measure that is already created.
and use variable button to switch between them.
Please let me know if you need a sample qliksense file with example.