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

Button Issue

Hello Guys,

I'm working on Qlik View..

I have created 4 buttons: both the couples select values from 2 different fields.

The first field is called "Regulated" and can return values : "YES / NO" ( one button select the regulated countries, the second one the non-regulated).

The second field is called "STOCK?" and can return values: "YES / NO" (the first button select all the countries YES, the second one select ALL the countries -so YES+NO).

These buttons has been set in order to change color, being grey normally and becoming green when clicked.

To do so, I have created 4 variables: butREG, butNOREG, butONLYCOUNT and butALL.

Each button has the following instructions:

select in the field

set butNAME (related button)=1,

and their color is set to If(button(related button) = 1, RGB(0, 255, 0), RGB(224,224,224))

I have also added the instruction =if(IsNull(GetCurrentSelections()), 0)  for each button, in order to make them all grey in case you clear the selections.

The issue is that when click on two different button (not complementary selection) the first one return to be grey, even if the selection is still active!

For example, if I filter all the regulated countries + "yes stock" I want to see both the button green.

Do you know how to fix it?

Thank you in advance

1 Solution

Accepted Solutions
Anonymous
Not applicable

Instead of using variables for the colors why don't you just do this in your color expression.

=If(GetFieldSelections(Regulated) ='YES', RGB(0, 255, 0), RGB(224,224,224))

And just modify it for each button.

View solution in original post

5 Replies
Anil_Babu_Samineni

Can you provide sample application

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
marikabi
Creator
Creator
Author

Hello,

see attached a sample

marikabi
Creator
Creator
Author

Hi,

I think the issue is that once I change the value of another variable, the remaining ones turn to be "-".

Is there any way (using the events maybe) to set the instruction : keep the variable value ?

Thanks

Anonymous
Not applicable

Instead of using variables for the colors why don't you just do this in your color expression.

=If(GetFieldSelections(Regulated) ='YES', RGB(0, 255, 0), RGB(224,224,224))

And just modify it for each button.

marikabi
Creator
Creator
Author

Thank you,

it works perfectly

Bye