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

Multiple IF Statements

How do we write Multiple IF Statements in Qliksense. I tried this way.

if((fabs($(Difference)))/($(Approved Limit Dec 13)) > 0.5,black())

if((fabs($(Difference)))/($(Approved Limit Dec 13)) > 0.9,red())

When I give only the first If statement, it works. On Line 2, when I introduce the second IF statement, the function does not work. Is there any issue with the syntax?

 

 

1 Solution

Accepted Solutions
marcus_sommer

Try this:

if(fabs($(Difference))/$(Approved Limit Dec 13) > 0.5,black(),

if(fabs($(Difference))/$(Approved Limit Dec 13) > 0.9,red()))

- Marcus

View solution in original post

3 Replies
marcus_sommer

Try this:

if(fabs($(Difference))/$(Approved Limit Dec 13) > 0.5,black(),

if(fabs($(Difference))/$(Approved Limit Dec 13) > 0.9,red()))

- Marcus

Not applicable
Author

Thank You. It worked.

jagan
Luminary Alumni
Luminary Alumni

Hi,

I think

if(fabs($(Difference))/$(Approved Limit Dec 13) > 0.9, Red(),

if(fabs($(Difference))/$(Approved Limit Dec 13) > 0.5,Black()))

Otherwise you will get all Black() colors. 0.9 is greater than 0.5, so It never comes to Else.

Hope this helps you.

Regards,

Jagan.