Skip to main content
Question

How to color code a table based on a forumla field?


Forum|alt.badge.img

I have a report I created where Days Remaining is a formula:

-(ToDays(Today() - ToDate([Due Date])))

I want to color code the table such that 

Days Remaining = 5  -> Red

Days Remaining = 5-10 -> Yellow

Days Remaining = 10+ -> Green

Days Remaining = Negative Number -> Purple

But I can't figure out how to use the results of the field formula in a formula in the color code area.   

 

TIA

 

QuickBaseJunkie
Forum|alt.badge.img+15

This should do it

var number DR = -(ToDays(Today() - ToDate([Due Date])));

If(
$DR = 5,"Red",
$DR > 5 and $DR <= 10,"Yellow",
$DR > 10,"Green",
$DR < 0,"Purple")

You can also replace the names like "Yellow" with a hex code like "#FDFD96" if you find the named color is not the best shade. Just be sure to include the pound sign.

-Sharon