Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show condition with 2 variables

Hi everyone,

is it possible to set up the show conditional of a list box on 2 variables?

I want to set 2 variables with 2 different buttons and if there is the right combination the list box should appeare.

With just 1 variable it works easy, but how can I handle 2?

Thanks for helping

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

like the attached app?

View solution in original post

20 Replies
qlikmsg4u
Specialist
Specialist

try show condition with if statement.

Something like  =If($(vVar1)=1 and $(vVar2)=2,1,0)

maxgro
MVP
MVP

just a small example, listbox visible when condition on variables  v1, v2 is

v1 and v2

1.png

Not applicable
Author

I've tested it and the more I think about it, the less sense makes it for me to use an if statement.

The normal usage of 'Show'  'Conditional' is something like: put vVar1=1 in the field. In this case the Box is shown if the variable vVar1=1 it is not necessary to create an own if statement. But the Problem is, a connection with 'and' is also not working.

Do u have any other ideas?

Anonymous
Not applicable
Author

it should work with 2 conditions which are connected with "and"

but other possibility would be to use a new variable which handles the state of your 2 bttuons

and the state you Need.

then us this new variable in your condition (newvar=1)

Not applicable
Author

Unfortunately, the example that you show does not work, because you've only used the variables, but it does not depend of the value of the variable. Just the existance of the variable is not sufficient. In addition, the connection with and, unfortunately, does not work.

Any other ideas?

Not applicable
Author

it do not work with 2 conditions which are connected with 'and'

can u give me more details or a explicit example how u would handle 1 variable with 2 buttons?

Kushal_Chawda

Try,

vShow1 or vShow2

or

vShow1 and vShow2

Not applicable
Author

Not sure what you mean by 'Just the existance of the variable is not sufficient'. And as you mentioned, If condition is not required. If both the variables' values are numeric and something other than zero (0), then the condition becomes TRUE and the object will be visible.

Can you give more details like, what you are doing when the buttons are clicked etc. Upload a sample QVW for quick resolution.

Regards,

KKR

Not applicable
Author

The first button set vVariable1=0 the second button set vVariable2=1.

The Listbox should be shown if there is the combination of vVariable1=0 and vVariable2=1