Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Background color expression

Hi All,

I am creating a Projects Management Dashboard and for some reason I cannot get the background colors working when the expression looks like this

IF(STATUS = 'In-Progress' AND Now() = QTR_END OR STATUS = 'Not Started' AND Now() > Project_Due_Date, RGB(255,255,0)),
     IF
(
STATUS = 'Not Started' OR STATUS = 'In-Progress AND Now() > QTR_END OR Now() > Project_Due_Date, RGB(255,0,0)),
          IF(STATUS = 'In-Progress', RGB(0,255,0)

Am I missing something or can I get the colors with a different method?

Thank you.

7 Replies
SunilChauhan
Champion II
Champion II

it better to post a sample for us.

Sunil Chauhan
Nicole-Smith

You have some parentheses in the wrong places.  Corrected formula (for syntax errors anyway):

IF(STATUS = 'In-Progress' AND Now() = QTR_END OR STATUS = 'Not Started' AND Now() > Project_Due_Date, RGB(255,255,0),

     IF(STATUS = 'Not Started' OR STATUS = 'In-Progress AND Now() > QTR_END OR Now() > Project_Due_Date, RGB(255,0,0),

          IF(STATUS = 'In-Progress', RGB(0,255,0))))

sudeepkm
Specialist III
Specialist III

IF((STATUS = 'In-Progress' AND Now() = QTR_END) OR (STATUS = 'Not Started' AND Now() > Project_Due_Date), RGB(255,255,0),
     IF
((
STATUS = 'Not Started' OR STATUS = 'In-Progress) AND (Now() > QTR_END OR Now() > Project_Due_Date), RGB(255,0,0),
          IF(STATUS = 'In-Progress', RGB(0,255,0))))

its_anandrjs
Champion III
Champion III

Hi,

Use some thing like

IF(STATUS = 'In-Progress' AND Now() = QTR_END OR STATUS = 'Not Started' AND Now() > Project_Due_Date, RGB(255,255,0),

     IF(STATUS = 'Not Started' OR STATUS = 'In-Progress' AND Now() > QTR_END OR Now() > Project_Due_Date, RGB(255,0,0),

          IF(STATUS = 'In-Progress', RGB(0,255,0))))

You miss the single code in field STATUS

Hope this helps

Thanks & Regards

Not applicable
Author

I tried all these but it does not work even though there is no error in the script. Thanks for responding. I am still trying to get it to work.

Anonymous
Not applicable
Author

Regardless the syntax and logic, I have a problem with

Now() = QTR_END

Now() is a timestamp, not a date.  This condition is virtually impossible to meet.  Maybe you mean

Today() = QTR_END

?

Not applicable
Author

Yes Michael, you are correct. Now() is always changing so can't use in if condition.