Skip to main content
Solved

GI Color formatting


claudematherne24
Jr Varsity III
Forum|alt.badge.img

I’m looking to figure out how to make my row styles based on the Days Lagging column, which is a formula that is the following:

=DateDiff('d', [SOOrder.OrderDate], Today())

 

I’d like to color code on the Days Lagging to show Red as greater than 90 days, yellow greater than 60 days, green greater than 30 days.  I’ve tried using a Switch statement that has IIf inside to do the same math, but I’m getting out of bound array issues.

 

What am I doing wrong lol?

Best answer by kyle90

I’m not an expert here but I believe =switch() won’t need an if statement, it applies the the logic in order and does nothing if your expression is not true

 

Try

=switch(

DateDiff('d', [SOOrder.OrderDate], Today())>’90’,’red20’,

DateDiff('d', [SOOrder.OrderDate], Today())>’60’,’yellow20’,

DateDiff('d', [SOOrder.OrderDate], Today())>’30’,’green20’

)

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+1

Hi, can you share your Switch statement that didn’t work for you?


Forum|alt.badge.img+1
  • Semi-Pro III
  • 100 replies
  • Answer
  • February 2, 2024

I’m not an expert here but I believe =switch() won’t need an if statement, it applies the the logic in order and does nothing if your expression is not true

 

Try

=switch(

DateDiff('d', [SOOrder.OrderDate], Today())>’90’,’red20’,

DateDiff('d', [SOOrder.OrderDate], Today())>’60’,’yellow20’,

DateDiff('d', [SOOrder.OrderDate], Today())>’30’,’green20’

)


claudematherne24
Jr Varsity III
Forum|alt.badge.img

yeah, I see the issue.  Don't know why my brain wanted to force the If there.

 

Thanks


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings