Qlik Community

QlikView Documents

Documents for QlikView related information.

Leverage your QlikView investment to modernize BI – see how! Join Group

QlikView App: Set Variable with an Action on a Button

MVP & Luminary
MVP & Luminary

QlikView App: Set Variable with an Action on a Button

This example shows how to set a variable using an action on a text box.  That same variable is used to dynamically change the colour of the text box - feeding back that a selection has been made.

The variables once set can be used as part of expressions (including set analysis) or for determining layout - such as showing or hiding certain objects or tabs.

The QlikView was originally written as a response to the following QlikCommunity thread:


I expand on the use of Actions on buttons, text areas and gagues in my blog post on the subject: QlikView Buttons - Where, Why and How

Steve Dark


Labels (1)
Not applicable

Hi Steve, thanks for the tutorial. I am running into problems when I add a 'select field' action to the button. When I click on the tool bar clear button, it remains on the previous variable selected (thus the button is highlighted) but it is misleading because it has cleared the selection. Is there anyway to set the clear button to clear the variable state?

MVP & Luminary
MVP & Luminary

Hi Lin,

You can use the GetFieldSelections function to check the current state of selections in that field:

=if(GetFieldSelections(YourFieldName) = 'Field Value', $(vColHighlight), $(vColNoHighlight))

You will need to have two variables set up with the colours in for this to work.  It has the advantage that if a user makes a selection without using the button it will also show.

It can get a bit fiddly if your button makes multiple selections in a field, or selections in multiple fields - but you can tend to get the logic correct eventually.

Another route is to set up a trigger on the field state - but I would not recommend this approach if you can avoid it.

I've created a post with a lot more detail on buttons, including a video demonstrating their use, at QlikView App: At The Qlik Of A Button - this may give you some more ideas.


Not applicable

Hi Steve,

That is awesome! Thank you, I've bee trying to figure this out for a few days. I will share this with my colleagues. Thank you!


MVP & Luminary
MVP & Luminary

Glad you think it's awesome. 

There's usually a way of achieving what you are after if you break the problem down into parts and it off a bit at a time.

Not applicable

Hi Steve,

This is very nice & really helpful to my work which I am looking for..Thanks

Version history
Revision #:
1 of 1
Last update:
‎2013-05-29 06:49 PM
Updated by: