Problems with a Case Statement

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • Answered
I have a case statement I am trying to build using checkboxes to show what stage a particular report is sitting on (based on the completion of child record Tasks). The last line would the default result if none of the others are true.

First problem is that it's telling me the second line is expecting a text value, and the last problem is how to get it to return the default value if the previous criteria aren't met.

Case(
ToNumber([Report Ready for Posting]) , 1 , "Posting" ,
ToNumber([Report Ready for Final Review]) , 1 , "Final Review" ,
ToNumber([Report Ready for 2nd Review]) , 1 , "2nd Review" ,
ToNumber([Report Ready to Review]) , 1 , "1st Review" ,
ToNumber([Report Ready to Process]) , 1 , "Report Processing" ,
ToNumber([Report Ready for LFee]) , 1 , "License Fees" ,
ToNumber([Report Payment Data Received]) , 1 , "Payments" ,
[# of Completed TSK]<2 , "Not Started")








Photo of Jennifer Peterson

Jennifer Peterson

  • 296 Points 250 badge 2x thumb

Posted 4 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,038 Points 50k badge 2x thumb
Case is really only used when you are testing the same field over and over, so I think that you are in an IF situation.

IF(
ToNumber([Report Ready for Posting])  = 1 , "Posting" ,
ToNumber([Report Ready for Final Review])  = 1 , "Final Review" ,
ToNumber([Report Ready for 2nd Review])  = 1 , "2nd Review" ,
ToNumber([Report Ready to Review])  =1, "1st Review" ,
ToNumber([Report Ready to Process])  =1, "Report Processing" ,
ToNumber([Report Ready for LFee]) =1 , "License Fees" ,
ToNumber([Report Payment Data Received])  =1 , "Payments" ,
[# of Completed TSK]<2 , "Not Started", "some other default result")


Photo of Jennifer Peterson

Jennifer Peterson

  • 296 Points 250 badge 2x thumb
Perfect! I knew it was going to be something simple that I overlooked. Thank you!
Photo of Kingsly SD Samuel

Kingsly SD Samuel

  • 476 Points 250 badge 2x thumb
Hi Mark,

Since this is of the same subject (problem with a case statement), I thought of raising this query in here. Here is my formula:

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 in 'image grey'. Can you help?