Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I require some assistance!
I have the above dataset, the minimum date in 'Date' is '01/03/2003' and maximum date is '01/01/2021',
I have a rquirement to colour code each record against the Date Column,
Current Month = Red (Feb 2012 at time of writing this)
Current Month+1 = Amber (Mar 2012 at time of writing this)
Anything greater Current Month+2 = Green (Apr 2012 onwards at time of writing this)
Anything less than Current Month = Grey (Jan 2012 backwards at time of writing this)
I understand this could be acheived through alot of nested if's, but was looking for a more elgant solution,
Any advice would greatly appreciated
There are 2 ways you can do this:
1. Use nested if's in chart background color or text color
2. Add a field that carries the 'colorcode' in script (this would use nested if again). In this approach, all you have to do is add field name into chart background color or text color:
if(MonthName(Date)=MonthName(Today()),LightRed(),if(MonthName(Date)=MonthName(Today(),1),yellow( ),if(MonthName(Date)>=MonthName(Today(),2),LightGreen(),DarkGray()))) as ColorCode
if(MonthName(Date)=MonthName(Today()),LightRed(),
if(MonthName(Date)=MonthName(Today(),1),yellow( ),
if(MonthName(Date)>=MonthName(Today(),2),LightGreen(),DarkGray()))) as ColorCode