Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Can anyone please help me to change the color of button when we select it.
Button color is blue right now, where as when we select it should change to green color.
Thanks.
Follow this:
1. Take Three Buttons
1. First
2. Second
3. Third
2. Take one Variable like "vClor" and assign 0 to it.
3. Now on First button set below action on "Set Variable"
=if(vColor=1 or vColor =2,0,0)
them First button only write below expression under Calculated with in Base color area:
=if(vColor=1 or vColor =2,0,0)
4. follow this step for Second and Third Button
Second Button:
=if(vColor=0 or vColor =2,1,1)
if(vColor=1,Green(), Blue())
Third Button
=if(vColor=1 or vColor =0,2,2)
if(vColor=2,Green(), Blue())
Use calculated Color for button color. Use the same variable use in the button action to control its color
If(vVar = 1, ActiveColor, DeactiveColor)
where vVar is button's action
You need to set an extra variable-value by clicking from this button, for example vColor to 0 or 1, maybe in this way:
set variable action
= if($(vColor) = 0, 1, 0)
button-color:
= if($(vColor) = 0, blue(), green())
- Marcus
Hi Sridhar
PFA Qlikview, You have to make you variables and just do some magic. Hope this qvw helps you
Regards
Chitra
Here i have three actions for button. So do i need to write nested if condition? Can u help on this?
Activate Object - CH02
Activate Object - CH04
Activate Object - CH06
I have created variable vColor with 0 value and
set variable action as
= if($(vColor) = 0, 1, 0)
button calculated color as
= if($(vColor) = 0, blue(), green())
But it is not working. Any problem in above lines?
Is there an initial value in vColor? If vColor is null neither expression will be valid and they will both be ignored.
Initialise vColor to 0 or 1 using the variable overview or an input box.
Please set a variable to change the color and set it in calculated section under backgroud color:
if(vChangeColor=1,RGB(0,255,0),RGB(0,0,255))
The remark from jontydkpi is right - you need to initialise this variable (to make another loop within the expressions to fetch this case is possible but not really useful - once set to 0 or 1 and it worked).
- Marcus
Hi Sridhar,
simple example attached
HTH - Andy