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

button?

i want give multiple action for one button? is it possible?

ex:  if i click on button then should display bar chart and when i click on same button second time then it should clear all selections ?

7 Replies
sagarkharpude
Creator III
Creator III

It's possible but you need to add two different action for that.

jyothish8807
Master II
Master II

Hi Qlik777,

You have to write a macro for that and run that macro through that button.

Regards

KC

Best Regards,
KC
ngulliver
Partner - Specialist III
Partner - Specialist III

Hi,

Have a look at http://www.quickintelligence.co.uk/qlikview-buttons/

This blog has an explanation with working examples.

Cheers,
Neil

Anonymous
Not applicable
Author

with out macro we can't?

maleksafa
Specialist
Specialist

create a variable call it vbuttonselection initialized to 0

when you first click on the button, on the first line set the variable to 1 if the value is 0 and to 2 if the value is 1: if(vbuttonselection = 0,1,2)

on the second line put your desired action to display the chart, with the condition on the vbuttonselection = 1, if(vbuttonselection=1,'CH23') (CH23 being the chart you want to display).

on the third line put your desired action to remove selection, with the condition on the vbuttonselection =2.

so the first time you click it will set the variable to 1 and will execute the second line (show chart), if you click again it will evaluate the variable and set it to 2 so the second line will not be executed and the third line to clear the selection will then be executed.

sushil353
Master II
Master II

Hi,

You can achieve this by using a variable.

create a variable say vButton and assign a value say 0

in button add action> set variable > and set the values as not(vButton):

now in your bar chart>layout> show condtional : =$(vButton)

and for clearing selection add trigger Settings>document properties>trigger> Variable Event Trigger> On Input > if($(vButton)=0,1,0)

HTH

Sushil

Anonymous
Not applicable
Author

It is possible. You just have to create a variable and modify the var value at each click on the button. For that, go to button properties, actions, add, and select modify variable. Fill in the name and the value: =mod($(vVar)+1, 3)      So, you will have a variable getting values from 0 to 2.

Now you go to the different objects you want to show/hide and put the condition

=if($(vVar)=0, 1, 0)    in the objects you want to show without click

=if($(vVar)=1, 1, 0)    in the objects you want to show when 1 click

=if($(vVar)=2, 1, 0)    in the objects you want to show when second click

Hope it helps.