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

If value is between 2 numbers then color x

Need a little help

We are trying to write a color expression for the following traffic light table:

If cop_overall_status is between 0-39 = Green

If cop_overall_status is between 40-89 =Yellow

If cop_overall_status is between 90-100 = Light Red

If cop_overall_status value equals 0 = Light grey

 

This is what I thought it would look like however I get an  Error message in QLIK

=if([cop_overall_status]={">=1 <=39"},Green(),if([cop_overall_status]={">=40 <=89"},Yellow(),if([cop_overall_status]={">=90 <=100"},LightRed(),if([cop_overall_status]=0,lightGray()))))

Thanks

Labels (2)
2 Replies
rubenmarin

Hi, thats not hte corect syntax for if(), try as

=if([cop_overall_status]>=1 and [cop_overall_status]<=39,Green()
  ,if([cop_overall_status]>=40 and [cop_overall_status]<=89,Yellow()
  ,if([cop_overall_status]>=90 and [cop_overall_status]<=100,LightRed()
  ,if([cop_overall_status]=0,lightGray())
)))
JBritten
Contributor
Contributor
Author

Thank you that worked