Discussions

Expand all | Collapse all

Problem with a 'case' statement

  • 1.  Problem with a 'case' statement

    Posted 10-15-2018 17:24
    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?


  • 2.  RE: Problem with a 'case' statement

    Posted 10-15-2018 19:01
    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\">")



  • 3.  RE: Problem with a 'case' statement

    Posted 10-15-2018 19:42
    Thank you Everett. This worked as well.