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

RAG conditional formatting.

Hi Experts, 

 

I have created an app covering multiple KPI's which has various splits and and drill downs. I have presented these as pivot tables and line charts. Within the pivot table I have been asked to RAG the results against targets for each of the areas.  I have been able to get a simple Red/Green if expression to work on the Background Colour Expression.

IF(Sum(Sales)/Sum(Hours))>=(Target), Red(), Green())

I was wondering if there was anyway to add an "Amber" to this if the result is within 10% of the target? 

Thanks in advance

1 Solution

Accepted Solutions
Or
MVP
MVP

You could simply nest two If() statements:

IF(Sum(Sales)/Sum(Hours)>=1.1*(Target), Red(),

if(Sum(Sales)/Sum(Hours)>=0.9*(Target), Yellow(),Green()))

And while you are of course free to color-code as you wish, I'd like to point out that it's typically better to only color-code the values that require attention / need to be colored for some specific purpose. In this case, every value will be colored, and the only difference is that instead of using black for the "regular" values that are roughly on target, you'll color them yellow.

 

 

View solution in original post

1 Reply
Or
MVP
MVP

You could simply nest two If() statements:

IF(Sum(Sales)/Sum(Hours)>=1.1*(Target), Red(),

if(Sum(Sales)/Sum(Hours)>=0.9*(Target), Yellow(),Green()))

And while you are of course free to color-code as you wish, I'd like to point out that it's typically better to only color-code the values that require attention / need to be colored for some specific purpose. In this case, every value will be colored, and the only difference is that instead of using black for the "regular" values that are roughly on target, you'll color them yellow.