Problem with a 'case' statement

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • Answered
Hi,

I need help with a case statement:

Case(
[Project Status],"Not Started", "<img src=\"https://images.quickbase.com/si/16/230-rect_blue.png\"; title=\"Not Started\">",
If([Actual End Date]>[Est End Date],"<img src=\"https://images.quickbase.com/si/16/227-rect_red.png\"; title=\"Project Overdue\">",
If(ToDays([Total Days Overdue])>0,"<img src=\"https://images.quickbase.com/si/16/170-alarm_clock.png\"; title=\"Milestone Overdue\">",
"<img src=\"https://images.quickbase.com/si/16/229-rect_yellow.png\"; title=\"On Time\">")), 
"In Progress", "<img src=\"https://images.quickbase.com/si/16/229-rect_yellow.png\"; title=\"In Progress\">", 
"Completed", "<img src=\"images.quickbase.com/si/16/228-rect_green.png\" title=\"Completed\">", 
"On Hold", "<img src=\"https://images.quickbase.com/si/16/231-rect_violet.png\"; title=\"On Hold\">", 
"Canceled", "<img src=\"https://images.quickbase.com/si/16/226-rect_gray.png\"; title=\"Canceled\">")

When the above formula is used, only the "Not Started" condition is getting applied, for all other status, it is pulling up "Canceled" condition (image grey). But, I want it to apply the relevant images for relevant project status. Can anyone help?
Photo of Kingsly SD Samuel

Kingsly SD Samuel

  • 476 Points 250 badge 2x thumb

Posted 2 months ago

  • 0
  • 1
Photo of Everett Patterson

Everett Patterson

  • 762 Points 500 badge 2x thumb
You can use an If statement instead of a Case statement.

If([Actual End Date]>[Est End Date],"<img src=\"https://images.quickbase.com/si/16/227-rect_red.png\"; title=\"Project Overdue\">",
ToDays([Total Days Overdue])>0,"<img src=\"https://images.quickbase.com/si/16/170-alarm_clock.png\"; title=\"Milestone Overdue\">",
[Project Status] = "Not Started", "<img src=\"https://images.quickbase.com/si/16/230-rect_blue.png\"; title=\"Not Started\">",
[Project Status] = "In Progress", "<img src=\"https://images.quickbase.com/si/16/229-rect_yellow.png\"; title=\"In Progress\">",
[Project Status] = "Completed", "<img src=\"https://images.quickbase.com/si/16/228-rect_green.png\"; title=\"Completed\">",
[Project Status] = "On Hold", "<img src=\"https://images.quickbase.com/si/16/231-rect_violet.png\"; title=\"On Hold\">",
[Project Status] = "Canceled", "<img src=\"https://images.quickbase.com/si/16/226-rect_gray.png\"; title=\"Canceled\">")

Photo of Kingsly SD Samuel

Kingsly SD Samuel

  • 476 Points 250 badge 2x thumb
Thank you Everett. This worked as well.