Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Background Color?

Hi,

I have an expression and will like to add a background color based on the result of that expression. How can I do it?

I mean I need that the field is set to Red if value is higher than 0.5 and green if it's lower than 0.5.

Please advise.

1 Solution

Accepted Solutions
sumitjadhav
Creator II
Creator II

Try the below expression:

if([Escalation Request Rate]>5/100,Red(),Green())

View solution in original post

20 Replies
Anil_Babu_Samineni

Try like below from your background color of your expression.


If(Field > 0.5, Red(), If(Field < 0.5, Green())

Or

If(Field>0.5, Red(), Green())

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

I mean, the expression is a field calculated that is a percentage, what should be the field that I should use? or it will works if I use the name of the expression?

sunny_talwar

I think you need to use the whole expression or you can use expression label

Anonymous
Not applicable
Author

Ok, something is not working.

I want to have all the pair months on grey, but also will like to have an specific color the expression is higher than 0.5 and another one if the expression is lower than 0.5.

This is what I am trying:

if (mod(Month,2)=0, RGB(128,130,133)) or if ([Escalation Request Rate] > 0.05, RBG('RED'), RGB (Green))

What am I doing wrong?

Anil_Babu_Samineni

May be this

Here i am assuming month is in Number format

if (mod(Month,2)=0, RGB(128,130,133) or [Escalation Request Rate] > 0.05, RED(), Green())


Or


if (mod(Month,2)=0, RGB(128,130,133),If(Sum([Escalation Request Rate]) > 0.05, RED(), Green()))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Is [Escalation Request Rate] your expression or expression label here?

Anonymous
Not applicable
Author

Yes, Escalation Request Rate is a field that will display percentage, however the expression is not working.

I have removed the first part if (mod(Month,2)=0, RGB(128,130,133)

But I am still not getting the right colors.

if ([Escalation Request Rate] > 0.05, RED(), Green())

I am seeing records in green where Escalation Request Rate is higher than 0.5%

sunny_talwar

Would you be able to share a screenshot of your chart and your background expression?

Anonymous
Not applicable
Author

The background expression is if ([Escalation Request Rate] > 0.05, RED(), Green())

As you can see the first 6 records are OK, but the seventh is not.