Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Having trouble getting the background color working in an IF statement.

I am new to QlikView. I am trying to get the background color correct for a straight table field. I have values from 3 different years (2014, 2013, 2012). If the 2014 value is greater than the 2013 value I want the column red, else green. Same for 2013. If 2013 is greater than 2012, I want it displaying red, else green.  So, in  the background color I have the following but the value is displaying green but it is higher than the 2012 value. The value for 2014 is 9.2 and the value for 2013 is 9.1. It should display red and it is not. Not sure what I am doing wrong.

=If ([CPI 2014 Score] >> [CPI 2013 Score],  RGB(255,0,0),

If ([CPI 2014 Score] << [CPI  2013 Score],  RGB(0,153,0)))

1 Solution

Accepted Solutions
swuehl
MVP
MVP

=If ([CPI 2014 Score] > [CPI 2013 Score],  RGB(255,0,0),

If ([CPI 2014 Score] < [CPI  2013 Score],  RGB(0,153,0)))

or

=If ([CPI 2014 Score] > [CPI 2013 Score],  RGB(255,0,0),  RGB(0,153,0))

View solution in original post

5 Replies
swuehl
MVP
MVP

=If ([CPI 2014 Score] > [CPI 2013 Score],  RGB(255,0,0),

If ([CPI 2014 Score] < [CPI  2013 Score],  RGB(0,153,0)))

or

=If ([CPI 2014 Score] > [CPI 2013 Score],  RGB(255,0,0),  RGB(0,153,0))

Not applicable
Author

Hi,

Thank you, that  solved it. Why does the expression tab add two >> instead of >      ....

Anyway thanks for solving for me.

swuehl
MVP
MVP

Not sure what you mean with 'Why does the expression tab add two >> instead of > '.

Where have you seen this happen?

Not applicable
Author

Inside the expression builder "definition" when i selected the fields for the expression, QlikView automatically popped up a dialog box with ">>"   "<<"   for me to select in building the expression. 

Not applicable
Author

by he way, the support here has been exceptional.