Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN 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.

20 Replies
Anil_Babu_Samineni

Try some thing like below

If(Num(sum([Escalation Request Rate]),'#,##0.00%')>Num('0.05%'), Red(), Green())

Or

If(sum([Escalation Request Rate])>Num('0.05%'), Red(), Green()) //Here, You should go to number tab and fixed it to % with Fixed To Two decimals for

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

That's weird, still not working.

Anonymous
Not applicable
Author

I cannot share it, but I won't use the background colors then, thank's all for their efforts.

Anil_Babu_Samineni

Are you expecting this in Listbox?

but I won't use the background colors then, .

What does that mean? Where you are trying this?

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
tcullinane
Creator II
Creator II

Is [Escalation Request Rate] a numeric or text field? You should make sure it is numeric (possibly wrap it in a dual to create numeric part)

Also 0.69% is less that 5%, so perhaps you should use 0.005 as you cut off point.

Anonymous
Not applicable
Author

You're right Thomas, I am using  if ([Escalation Request Rate] > 0.05, RED(), Green()) , so 0,69% should be lower than 0,05 or am I wrong?

Also, in the expression's section I have the Escalation Request Rate like text representation, but I am not seeing any other type that I can use as number or something like that.

Anonymous
Not applicable
Author

No, I expected this in a Straight table, but for some reason the expression in the background color is not working.

tcullinane
Creator II
Creator II

So why is it incorrect that it is green in you above example?

To check that your field is actually numeric go to the number property tab in your straight table and untick show in % on the [Escalation Request Rate] field or change the decimal places shown.

sumitjadhav
Creator II
Creator II

Try the below expression:

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