
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If statement to color cells red or green
Hello,
I have an expression in the custom format cell area of my table and I want it to color the cell red if the value is 'N' and green if the value is 'Y'.
if
(Complete = 'N', red(), if(Complete = 'Y', green())
I have this expression that works, except if one value is 'Y' it colors the entire column green instead of just the individual cell. Anyone have any idea why this is happening?
- Tags:
- cell
- new_to_qlikview
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Brandon,
Go to your your "Expression" > Background Color > Write your "expression" for color change as showed in the image > OK > Apply > OK.
Kind regards,
Ishfaque Ahmed

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What kind of table are you using?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a straight table

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you try using "Visual Cues" tab?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Instead of using the custom format cell function go to the expressions tab and enter your expression in background color
Click the plus next to the expression you want to conditionally color and then click on background color and paste your expression into the definition box.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Brandon,
Go to your your "Expression" > Background Color > Write your "expression" for color change as showed in the image > OK > Apply > OK.
Kind regards,
Ishfaque Ahmed


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If the above suggestions doesn't work for you.
Go to the expression tab and expand your expression by clicking at '+ '. Choose text format apply like this
if((Complete= 'N',Red(),Green())
Hope this helps
Regards
Krishna


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this expression,
if(Complete = 'N', red(), green())
