Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help with a condition

Hi, I have a button I would like to hide if the user hasnt selected a value from a column. Right now I am populating the value selected into a variable, so its like:

vName = Only(Table.Name)

So I would like to evaluate vName so that if it = '', then I will hide the button using the Show Condition. Any ideas how I can do this?

So IF vName = ''

     then <hide>

ELSE

     show.

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

in properties of the button, tab layout, section show:

set in the conditional box:

=getselectedcount(myField) > 0

let me know

View solution in original post

7 Replies
Not applicable
Author


What would be even cooler, would be to leave the buttons, but just fade them out, as opposed to hiding them, if that were possible...

alexandros17
Partner - Champion III
Partner - Champion III

in properties of the button, tab layout, section show:

set in the conditional box:

=getselectedcount(myField) > 0

let me know

Not applicable
Author

Ah thanks, but the field is a string, not a number, will this make a difference as you have > 0 there. I was expecting ' '...

Nope that works perfectly! Thanks

Any ideas if I can just grey the button out and disable it, as opposed to hiding it?

carvalguil
Contributor III
Contributor III

You don't need to use a variable.

Just right click the button and go to the Background color window. In the "Base Color" area, choose "Calculated" and add your formula. The one shown below set the button background as Blue if the selected value is equal 1 and a light blue if it's not equal 1.

if(Field = 1, ARGB(255, 0, 0, 255), ARGB(50, 0, 0,255))

Not applicable
Author

Cool, but even if its light blue, it will still be able to be enabled, right? I want to disable the function too.

carvalguil
Contributor III
Contributor III

There is a "Enable Condition" in the Button Properties Page. Just set it to Field = 1 (my example) and it will be disabled when a value not equal 1 is selected.

Not applicable
Author


Perfecto. Many, many thanks.