# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for
Did you mean:
Creator II

## How do I color a dimension consisting two fields with same expression?

Hi, I have a dimension based on the formula

IF(len(trim([CONTAINER]))=0,'OFF-LINE','ON-LINE') as OFF_ON_LINE

The expression for the above dimension is count(distinct case#).

How can I color the cells in straight table such a way that for OFFLINE below 70 is red and above 70 is green, and for ONLINE below 110 is red and above 110 is green?

1 Solution

Accepted Solutions
Champion

Hi,

did you try using the background color expression section of the dimension ?

using an expression like this:

=if(OFF_ON_LINE='OFF-LINE',

if(count(distinct case#)<70,

red(), if( count(distinct case#)>70, green())),

if(count(distinct case#)<110, red(), if(count(distinct case#)>110, green())))

10 Replies
Champion

Hi,

did you try using the background color expression section of the dimension ?

using an expression like this:

=if(OFF_ON_LINE='OFF-LINE',

if(count(distinct case#)<70,

red(), if( count(distinct case#)>70, green())),

if(count(distinct case#)<110, red(), if(count(distinct case#)>110, green())))

Champion III

May be this?

= IF(Count(DISTINCT {< OFF_ON_LINE = {'OFF-LINE'} >} Case#) < 70, Red(),

Count(DISTINCT {< OFF_ON_LINE = {'OFF-LINE'} >} Case#) > 70, Green(),

Count(DISTINCT {< OFF_ON_LINE = {'ON-LINE'} >} Case#) < 110, Red(),

Count(DISTINCT {< OFF_ON_LINE = {'ON-LINE'} >} Case#) > 110, Green())

Creator II
Author

Converts every cell into red color.

Creator II
Author

It says error in expression.

Champion

just check the expression (parentheses...)  this is how you color your cells

Champion III

Can you share your expression you are using and if possible share your qvw file to work on?

Creator II
Author

Oops my bad, forgot that case# is case sensitive. It works, thanks Youssef.

Creator II
Author

Thanks for your response Nagaraju, the answer provided by Youssef above worked.

Champion

You're welcome good luck