Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
amber2000
Creator
Creator

Complex IF Statement


Hello everybody,

I'm strugling with an expression that contains a nested if statement on the Text Color propertie.

If(([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100 >= 50.0,

  If((
[Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100 >= 50.0 and [Reele_loc_Hgt] >= 185, green(),red()))

The above statement is working as it should but the first rule should contain one more logic comparison:

If(([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100 >= 50.0 and ([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100 <= 99.99,

When I implement this my rules are not applied.

I'll attach an example to see what I'm doing, I also use the visual cues.

Can anybody help me with this please ???

Kind regards,

Ambertje

1 Solution

Accepted Solutions
Not applicable

Ok for that use the below.

If(([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100 >= 50.0 and ([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100<=99.9,green(),

  If(([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100 >= 100.0 and [Reele_loc_Hgt] >= 185, green(),red()))

View solution in original post

4 Replies
Not applicable

Hi,

Is this what you are looking for?

If(([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100 >= 50.0 and ([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100<=99.9,green(),

  If(([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100 >=100.0 and [Reele_loc_Hgt] >= 185, red()))

amber2000
Creator
Creator
Author

Sorry Reddy but this is not correct,

Both If statements should result as green and all that doesn't match should be in red.

Not applicable

Ok for that use the below.

If(([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100 >= 50.0 and ([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100<=99.9,green(),

  If(([Colli/Ti/PO*Cse_Hgt] / [Reele_loc_Hgt])*100 >= 100.0 and [Reele_loc_Hgt] >= 185, green(),red()))

amber2000
Creator
Creator
Author

Thank you so much, now I see how to build a nested If, totaly different then how I used nested If's in excel for example.

Kind regards,

Ambertje