Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mutiple Action with one button

Hello,

I am new to qlikview. I wonder if anybody could solve my problem with buttons.

I am trying to define multiple functions on single button. For example:- on my first click the button should minimize one object and on second click it should maximize that object, there could be any action for that matter.

Thanks,

Varun Singhal

1 Solution

Accepted Solutions
marchoctober
Creator
Creator

Hi!

If those multiple fuctions to the button running under one logic, f.e. first click switches something, and secon click is switching off something, then you could simply use well known solution:

Create a variable, Settings> Variable overview>Add

Then create a button, and in Actions, External>Set variable

There at the top set the variable created and in the bottom field include some simple logic:

=if(vVar=0,1,0) if variable value is equal to 0, then return the value 1 and set it to vVar, else return 0. So every time button is clicked vVar value will always contineously switched between 1 and 0.

Note, that you should set also first variable definition to 1 or 0, depending on what you will define in Layout section of an object.

As you could see abovem we set only button settings, now we should add Layout setting to an object (or objects) that this button sould reflect its actions.

Choose any Object (chart, text object, list etc.) and in Layout sections set Layout conditional to that Variable value that fits your logic:

vVar=1, this will mean that this object will be visible only vVar=1 is true, else it will be hidden.

You could use this to practice in other varians to do in visualisation, for example, switching variables, expressions, also try to set as button action a couple or more actions with logic.

As for the main question minimize and maximize I would recommend you to use simply two buttons, one for minimize object, and button disappears, but appears exactly the same but with action in it to maximize the minimized object.

There are also other solutions, using triggers, macro, snowfall with a way mentioned in this article etc.

Thank you,

Eugene

View solution in original post

11 Replies
MayilVahanan

Hi

For your requirement, you can use two button and show / hide that buttons based on clicks.

Note: Keep both button in same height, width and positions.

It solves your scenario.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
ngulliver
Partner - Specialist III
Partner - Specialist III

Hi, Varun.

You can have two buttons -  one to minimize, one to maximize - sitting in the same location. What you can do is use the show/hide function on them so that when the minimize function is used, only the maximize button can be seen etc

Regards,

Neil

alexandros17
Partner - Champion III
Partner - Champion III

To minimize and maximize you need macro, but it is better not to use macros ... I suggest to you the hide / show of an object with the conditional view; set a variable and set the hide and show depending on the variable value

aveeeeeee7en
Specialist III
Specialist III

Hi Varun

Check the Attachment.

May this help you out.

Regards

Aviral

marchoctober
Creator
Creator

Hi!

If those multiple fuctions to the button running under one logic, f.e. first click switches something, and secon click is switching off something, then you could simply use well known solution:

Create a variable, Settings> Variable overview>Add

Then create a button, and in Actions, External>Set variable

There at the top set the variable created and in the bottom field include some simple logic:

=if(vVar=0,1,0) if variable value is equal to 0, then return the value 1 and set it to vVar, else return 0. So every time button is clicked vVar value will always contineously switched between 1 and 0.

Note, that you should set also first variable definition to 1 or 0, depending on what you will define in Layout section of an object.

As you could see abovem we set only button settings, now we should add Layout setting to an object (or objects) that this button sould reflect its actions.

Choose any Object (chart, text object, list etc.) and in Layout sections set Layout conditional to that Variable value that fits your logic:

vVar=1, this will mean that this object will be visible only vVar=1 is true, else it will be hidden.

You could use this to practice in other varians to do in visualisation, for example, switching variables, expressions, also try to set as button action a couple or more actions with logic.

As for the main question minimize and maximize I would recommend you to use simply two buttons, one for minimize object, and button disappears, but appears exactly the same but with action in it to maximize the minimized object.

There are also other solutions, using triggers, macro, snowfall with a way mentioned in this article etc.

Thank you,

Eugene

Not applicable
Author

hi varun

please find attchment

I have implemented in single button

for minimizing and maximizing Chart

marchoctober
Creator
Creator

It is also one of the options, mix of several simultaneous actions in one button:

First two actions are maximizing or minimizing the object (conditional only one rule is used at a time, as the other is blocked by logic statement with IF in its value), and third action is sets the variable used in logic of first two actions:)

Here is one of the slutions I mentioned, mix with actions.

Not applicable
Author

hi varun ,

have tried my recent single_button.qvw

marchoctober
Creator
Creator

Can we provide any assistance further? As the question still not answered.