Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
martin_hamilton
Creator
Creator

How do I change background/text colour based on a date met

Hi

I have a formula which places a background onto a cell when the date is less than today - which is working fine.

= if(Sub_Contract_End_Date <= Today(), YELLOW())

How do I amend to pick up dates greater than today and have a differing colour for them, i have got to the below but cant think of how to introduce an OR statement

= if(Sub_Contract_End_Date <= Today(), YELLOW())= if (Sub_Contract_End_Date => Today()+30, RED())

9 Replies
trdandamudi
Master II
Master II

May be as below:

= if(Sub_Contract_End_Date <= Today(), YELLOW(), if (Sub_Contract_End_Date >= Today()+30, RED() ))


sujayrpatil
Partner - Contributor III
Partner - Contributor III

Hi Martin,

I think this would do, try it .

= if(Sub_Contract_End_Date <= Today(), YELLOW(),  RED() )

millan123
Creator II
Creator II

Please Try this

= if(Sub_Contract_End_Date <= Today(), YELLOW(), if (Sub_Contract_End_Date >= Today(), RED() ))

jeevays7
Partner - Creator III
Partner - Creator III

Hi Martin,

Try this,

= IF(Sub_Contract_End_Date <= Today(), YELLOW(),

IF(Sub_Contract_End_Date >= Date(Today()+30), RED()))

amit_saini
Master III
Master III

Hi Martin,

This might help u:

https://community.qlik.com/message/823603#823603

Thanks,

AS

Chanty4u
MVP
MVP

try below

bg.PNG

martin_hamilton
Creator
Creator
Author

Hi All

Unfortunately these formulas are highlighting all future dates in RED as well when I actually only want the dates 30 days from todays date. I was thinking something like the below might work but cant get the formulas right:

'>=' & Date(Today(), 'DD/MM/YYYY') & '<=' & Date(Today()+30

Thanks

trdandamudi
Master II
Master II

May be as below:

= if(Sub_Contract_End_Date <= Today(), YELLOW(), if (Sub_Contract_End_Date > Today() AND Sub_Contract_End_Date <= Today()+30, RED() ))



jeevays7
Partner - Creator III
Partner - Creator III

Try This,

1. below todays dates are yellow and 30th day from today only is red.

= IF(Sub_Contract_End_Date <= Today(), YELLOW(),

IF(Sub_Contract_End_Date = Date(Today()+30), RED()))


2. This only for 30 days date in red from today.

= IF(Sub_Contract_End_Date <= Today(), YELLOW(),

IF(Sub_Contract_End_Date <= Date(Today()+30 and Sub_Contract_End_Date > Today()) , RED()))