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

Multiple If/than color expressions

Hello,

I am stuggling to find the correct syntax to create a 3 (or 4) color expression in QlikSense.  I am successful in Red / Green but when I attempt to create a 3rd variable or 4th, it falls apart.

Field NameSum([ISSUES P1-Critical]

Success with 2 Color Expression:  If (Sum([ISSUES P1-Critical])>10, lightred(),lightgreen())

Fail with 3 Color Expression:  Try #1

This equation fails, the error in expression states: ')' expected


if (Sum ( [ISSUES P1-Critical] ) <10, lightgreen(), if( Sum ( [ISSUES P1-Critical])=>10 and Sum ( [ISSUES P1-Critical])<=50,Yellow(), lightRed() ) )

If Sum of Issues is greater/equal to than (=<) 50, Red

If Sum of Issues is between 10 and 50 = Yellow

If Sum of Issues is less than (>) 10, Green.

Thank you

1 Solution

Accepted Solutions
robert_mika
Master III
Master III

Change the signs

if (Sum ( [ISSUES P1-Critical] ) <10, lightgreen(), if( Sum ( [ISSUES P1-Critical])>=10 and Sum ( [ISSUES P1-Critical])<=50, Yellow(), lightRed()))

View solution in original post

7 Replies
Not applicable
Author

hi,


your problem is the sign line 2.


if (Sum ( [ISSUES P1-Critical] ) <10, lightgreen(),

if( Sum ( [ISSUES P1-Critical])=>10 and Sum ( [ISSUES P1-Critical])<=50,

Yellow(), lightRed() ) )

=> doesn't work

>= works

Sign: =  />= / <=

Julien

Not applicable
Author

Julien,

Thank you for that sign help.  I no longer get an expression error, however, I am not getting a 3 color variant.

if (Sum ( [ISSUES P1-Critical] ) <10, lightgreen(), if( Sum ( [ISSUES P1-Critical])<=10 and Sum ( [ISSUES P1-Critical])>=50, Yellow(), lightRed()))

All Numbers <10 are green (that is good)

All numbers equal to or greater than 10 and less than 50 are red, the middle range between 10 and 50 is not yellow, its red too, is not getting picked up at all.  is there a better way in QlikSense to write the logical clause? 

Not applicable
Author

if (Sum ( [ISSUES P1-Critical] ) <10, lightgreen(),

if( Sum ( [ISSUES P1-Critical])<=10 and Sum ( [ISSUES P1-Critical])>=50, Yellow(),

lightRed()))

your expression is contradictory because line 1 you want <10 and line 2 <=10

all sign are reversed.

Try this:

if (Sum ( [ISSUES P1-Critical] ) <10, lightgreen(),

if( Sum ( [ISSUES P1-Critical])>=10 and Sum ( [ISSUES P1-Critical])<=50, Yellow(),

lightRed()))

For qliksense, it's a good way and the most simple.

robert_mika
Master III
Master III

Change the signs

if (Sum ( [ISSUES P1-Critical] ) <10, lightgreen(), if( Sum ( [ISSUES P1-Critical])>=10 and Sum ( [ISSUES P1-Critical])<=50, Yellow(), lightRed()))

Not applicable
Author

or try this:

if (Sum ( [ISSUES P1-Critical] ) <10, lightgreen(),

if( Sum ( [ISSUES P1-Critical])>50, lightRed(),Yellow(),))

this expression works with <10 or >50.

Sorry for my english

Not applicable
Author

Thank you so much.  I very much appreciate your guidance.

Not applicable
Author

Julien - thank you as well.  Its working now. I appreciate it.