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

Multiple condition color expression

I'm trying to place two conditions on a color. I'm using the below expression for red, amber, green but I want to write something along the lines of IF (SUM([Current]-[Original]) < 1 and [DISCUSSION FLAG] = 'X', GREEN().


How do I write 2 conditions for a color based off of 2 data points?


IF (SUM([Current]-[Original]) < 1, GREEN(),

IF ([AT RISK] = 'X', YELLOW()

,RED()))

1 Solution

Accepted Solutions
sunny_talwar

Have you tried this already?

If(Sum([Current] - [Original]) < 1 and [DISCUSSION FLAG] = 'X', Green(), If([AT RISK] = 'X', Yellow(), Red()))

View solution in original post

4 Replies
sunny_talwar

Have you tried this already?

If(Sum([Current] - [Original]) < 1 and [DISCUSSION FLAG] = 'X', Green(), If([AT RISK] = 'X', Yellow(), Red()))

james_westbrook
Contributor
Contributor
Author

Thanks Sunny. I tried it again and it worked. I must have fat fingered it the first time.

If(Sum([Current] - [Original]) < 1 and [DISCUSSION FLAG] = 'X', RGB(150,255,150),

If(Sum([Current] - [Original]) < 1 and [DISCUSSION FLAG]  <>'X', Green(),

If(Sum([Current] - [Original]) > 1 and [DISCUSSION FLAG]  = 'X', RGB(255,150,150),

If([AT RISK] = 'X', Yellow()

, Red()))))

JohnDataAnalyst
Contributor II
Contributor II

Hi Sunny,

I have a similar problems with which I hope you can help.

First problem: I have the field [Pest Qty] which I want to assign three colors to. Any value below 2 should be green, any value between 2 and 5 should be yellow and anything above 5 should be red.

Second problem: I have to assign the above colors to the dimension [PDDD] and within that dimension I would only like to apply that to 'BI' as a subsection of [PDDD].

Third problem: I have multiple subsections of [PDDD], e.g 'BI' 'MEALYBUG' 'FRUIT FLY' with different ranges  for each.

Thanks,

JohnDataAnalyst
Contributor II
Contributor II

I tried the following:

If(Sum([Pest Qty?])<=2 and PDDD='BI',Green()
If(Sum([Pest Qty?])>2 and PDDD='BI', Yellow()
If(Sum([Pest Qty?])>5 and PDDD='BI', Red())))

but to no avail.