Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
That's weird, still not working.
Would you be able to share a sample?
Preparing examples for Upload - Reduction and Data Scrambling
I cannot share it, but I won't use the background colors then, thank's all for their efforts.
Are you expecting this in Listbox?
but I won't use the background colors then, .
What does that mean? Where you are trying this?
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.
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.
No, I expected this in a Straight table, but for some reason the expression in the background color is not working.
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.
Try the below expression:
if([Escalation Request Rate]>5/100,Red(),Green())