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

if condition - image visibility

hi,

there are 3 text boxes with 3 expressions

1- =Sum({<Company ={'My Company'}>}Post)

2- =Sum({<Company ={'Company A'}>}Post)

3- =Sum({<Company ={'Company A'}>}Post)

there an image which i want to be displayed if value of 1st expression is greater thn 2nd and 3rd expression.

i have used if and 'and', but somehow i guess i am missing something.

can you suggest the expression for this.

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

I don't see any difference between the second and third expression. In general you need something like this: =If( exp1 > exp2 and exp1 > exp3, 1, 0)

You could use variables to store the expressions and use the variables in the text boxes and the conditional display expression:

vVar1: =Sum({<Company ={'My Company'}>}Post)

vVar2: =Sum({<Company ={'Company A'}>}Post)

vVar3: =Sum({<Company ={'Company B'}>}Post)

Textbox1: =$(vVar1)

Textbox2: =$(vVar2)

Textbox3: =$(vVar3)

conditional display expression: =if( $(vVar1) > $(vVar2) and $(vVar1) > $(vVar3), 1, 0)


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

I don't see any difference between the second and third expression. In general you need something like this: =If( exp1 > exp2 and exp1 > exp3, 1, 0)

You could use variables to store the expressions and use the variables in the text boxes and the conditional display expression:

vVar1: =Sum({<Company ={'My Company'}>}Post)

vVar2: =Sum({<Company ={'Company A'}>}Post)

vVar3: =Sum({<Company ={'Company B'}>}Post)

Textbox1: =$(vVar1)

Textbox2: =$(vVar2)

Textbox3: =$(vVar3)

conditional display expression: =if( $(vVar1) > $(vVar2) and $(vVar1) > $(vVar3), 1, 0)


talk is cheap, supply exceeds demand
tresesco
MVP
MVP

If( Sum({<Company ={'My Company'}>}Post) > Sum({<Company ={'Company A'}>}Post) And

     Sum({<Company ={'My Company'}>}Post) > Sum({<Company ={'Company B'}>}Post) , ..Then...)

sasikanth
Master
Master

try some thing like

if(Exp1>Exp2 and Exp1>Exp3 , image,0)

OR

if(num(Exp1)>num(Exp2) and num(Exp1)>num(Exp3) , image,0)