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: 
Anonymous
Not applicable

color expression for date

I need expression for date please, like:

green color = 2 months or above

red color = expired

yellow color = 1 month or less

like the following:

Color Measures

Untitled.png

6 Replies
Frank_Hartmann
Master II
Master II

can u provide sample qvw?

Anonymous
Not applicable
Author

Hi Mr. Frank,

find the attached file please.

vishsaggi
Champion III
Champion III

May be this?

Attached.

Anonymous
Not applicable
Author

vishsaggi‌ I can't open the file because I don't have a license, can you please copy & paste the expression here !

Best regards

hemanthaanichet
Creator III
Creator III

Go to expression tab

expand the +

background color

Apply the below expression

=IF([Contract Validity] >= Date(AddMonths(Today(),2), 'MM/DD/YYYY'), RGB(0,202,101), IF(Year([Contract Validity]) <Year(Today()), LightRed(), IF([Contract Validity] < Date(AddMonths(Today(),1), 'MM/DD/YYYY'), Yellow())))

vishsaggi
Champion III
Champion III

In your expression tab - Background Color, use below:

= IF(Year([Contract Validity]) < Year(Today()), LightRed(),

  IF([Contract Validity] >= Date(AddMonths(Today(),2), 'MM/DD/YYYY'), RGB(0,202,101),

  IF([Contract Validity] < Date(AddMonths(Today(),1), 'MM/DD/YYYY'), Yellow())))