Skip to main content
Question

Case function syntax error

  • May 24, 2016
  • 0 replies
  • 25 views

I am trying to implement the solution described in this article http://quickbase.intuit.com/quickbase-blog/colorful-icons-make-quickbase-faster but I am getting a syntax error on my case function. Help!

I've attached a picture of my code, because pasting it here wasn't working (it was converting the HTML).

This topic has been closed for replies.

if you post your code and put spaces in the h t t p s then it will not render the code as html and I can correct it.  You have a bunch of extra " quotes.

  • Author
  • Quickbase Alumni
  • May 24, 2016
Ah! Thanks.

Case([RAG Status],"Red","<img src="h t t ps://images.quickbase.com/si/24/221-point_red.png">",
"Amber","<img src="h t t ps://images.quickbase.com/si/24/223-point_yellow.png">",
"Green","<img src="h t t ps://images.quickbase.com/si/24/222-point_green.png">")

Case([RAG Status],

"Red","<img src=h t t ps://images.quickbase.com/si/24/221-point_red.png>",
"Amber","<img src=h t t ps://images.quickbase.com/si/24/223-point_yellow.png>",
"Green","<img src=h t t ps://images.quickbase.com/si/24/222-point_green.png>")

  • Quickbase Alumni
  • December 8, 2017
A similair situation though a bit different...

I would like to use the progress bar icons
https://login.quickbase.com/db/bcgnn27bx?act=QuickSearch&srchtxt=progress&Find=
on a 'Formula%" field based on a field called ie %Milestone

something like (in my human logic & language)
if ( [ %milstone]=0, "<img src=https://login.quickbase.com/up/bcgnn27bx/g/rzd/eh/va/progress0.png>",
if ( [ %milstone]> 0 and [ %milstone] <25 , "<img src=https://login.quickbase.com/up/bcgnn27bx/g/rze/eh/va/progress25.png>",
if ( [ %milstone]> 24 and [ %milstone] <50 , "<img src=https://login.quickbase.com/up/bcgnn27bx/g/rzf/eh/va/progress50.png>",
if ( [ %milstone]> 49 and [ %milstone] <75 , "<img src=https://login.quickbase.com/up/bcgnn27bx/g/rzg/eh/va/progress75.png>",
if ( [ %milstone]=100, "<img src=https://login.quickbase.com/up/bcgnn27bx/g/rzh/eh/va/progress100.png>",
)))))

This is however not the proper code for QB i'm afraid.
I tried different variations but can't find the proper context yet

syntax check replies "Please check the syntax of your formula. Look for mismatched parentheses, missing quotes, or extra brackets." and points to the first '('

Any suggestions?

Try this.  unlike Excel you do not need to nest your IFs, so most IF statements only need one IF.



if (
[ %milstone]=0, "<img src=https://login.quickbase.com/up/bcgnn27bx/g/rzd/eh/va/progress0.png>",

[ %milstone]> 0 and [ %milstone] <25 , "<img src=https://login.quickbase.com/up/bcgnn27bx/g/rze/eh/va/progress25.png>",

[ %milstone]> 24 and [ %milstone] <50 , "<img src=https://login.quickbase.com/up/bcgnn27bx/g/rzf/eh/va/progress50.png>",

[ %milstone]> 49 and [ %milstone] <75 , "<img src=https://login.quickbase.com/up/bcgnn27bx/g/rzg/eh/va/progress75.png>",
[ %milstone]=100, "<img src=https://login.quickbase.com/up/bcgnn27bx/g/rzh/eh/va/progress100.png>")


Also note that if your [% milestone field is a % format, then it's value will range from 0.00 to 1.00

so your 2nd  line will ned to read 

[ %milstone]> 0 and [ %milstone] <0.25 ,  ......

and you will need to adjust the rest of the lines.

  • Quickbase Alumni
  • December 8, 2017
Thanks  i will try to make myself comfortable with it for a next occasion.

OFF-TOPIC
For those who strggle with similair issue and land on this thread:
Looking at function and presentation I think i will follow a different path as explainded here
https://community.quickbase.com/quickbase/topics/-completed-button.