Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
robertocesp
Creator II
Creator II

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())

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
robertocesp
Creator II
Creator II
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

robertocesp
Creator II
Creator II
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()))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
sunny_talwar

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

robertocesp
Creator II
Creator II
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?

robertocesp
Creator II
Creator II
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.