Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Drake
Contributor
Contributor

Background color expression

Hi,

I have a table in Qlik Sense with several fields, most using average expressions and some using sums. We need to apply background color expressions to these fields, with colors being green and red. For example, for the field "Average days to pay", if the value is greater than 3, it should be red, and if it is 3 or less, it should be green. I am currently using this expression:

IF(company = 'xyz' and Avg([Average days to pay])<=3, 'green')&

IF(company = 'xyz' and Avg([Average days to pay])>=3, 'red')

However, this isn't working because the average value (e.g., 3.48) is being rounded to 3 in the sheet. I've amended the expression to:

IF(company = 'xyz' and Avg([Average days to pay])<=3.49, 'green')&

IF(company = 'xyz' and Avg([Average days to pay])>=3.50, 'red')

This works, but with many columns to amend and i have many companies in single column, I’m looking for a more efficient solution. Any suggestions?

 

many thanks in advance

Labels (4)
1 Reply
vincent9874
Contributor
Contributor

Hello!

Use a single Pick function with conditions to apply green or red background colors based on the average value in Qlik Sense.

 

 

Best Regards,

disneyhub