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

Change button value, when clear all selections is clicked.

Hello,

I have a button that changes the filtering of certain fields when it is clicked. The text on the button changes from order to request on clicking and vice versa (this is achieved by creating a variable vhide and when the value is 1 it shows order).


When i click the clear all selections button the button shows the same value (order or request) . I want the button to show 'Order' each time when I press clear all selections button.


Thank You.

13 Replies
Sergey_Shuklin
Specialist
Specialist

When you hit a Clear All button the value of GetCurrentSelection() function becomes null. So, all you need is write one more condition in button text like I wrote above:

=if(isnull(GetCurrentSelections())=-1,'Order',if(vhide=1,'Order','Request'))

See the picture below:

button_1.png

After I clicked "Cleat All" button the text has changed:

button_2.png

Hope it helps!

Not applicable
Author

How are we able to assign a bookmark to the clear all button then? I assumed if we are able to assign something to the clear all button we could also change the variable associated to a button.

Not applicable
Author

It didn't work when i incorporated it in my code :

=if(isnull(GetCurrentSelections())=0, 'Current Filter: Order Date',

if(vhide=1,'Current Filter: Request Date', 'Current Filter: Order Date'))

Is that right ?

Sergey_Shuklin
Specialist
Specialist

Hi, Rahul!

It wouldn't work because you set your first codition as isnull(GetCurrentSelections())=0.

Your expression sounds like "When something is selected pick 'Order date'...", but if I understood you correctly you want to get 'Order date' each time when you press clear all selections button. Solving that case try to use isnull(GetCurrentSelections())=-1, it means "When nothing is selected pick...".