Row color, syntax error

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I want to highlight every row that falls below 50% of Baseline Inventory.  I want a different color for a specific Raw Material Vendor that falls below 50% of the Baseline Inventory:

 If(

([Available Inventory]<0.5*[Baseline Inventory]), "#FFFFCC",

([Available Inventory]<0.5*[Baseline Inventory] and [Raw Material Vendor]"KT Manufacturing, Inc."), "#99FFFF", ""

)

I get a closing parenthesis is missing error 

Photo of Suzanne

Suzanne

  • 10 Points

Posted 3 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
Try this.  I think that you were missing an equal sign. I also removed extra brackets and stuff that was not needed and added some spacing for readability.



I also suggest putting a comment on your hex code colors, as when you go to read the formula it's tough to know what color they will render as.



If(

[Available Inventory] <0.5 * [Baseline Inventory], "#FFFFCC", // I suggest a comment here like pink

[Available Inventory] <0.5 * [Baseline Inventory] and [Raw Material Vendor] = "KT Manufacturing, Inc."), "#99FFFF") // I suggest a comment here like blue
Photo of Suzanne

Suzanne

  • 10 Points
Formula syntax error

There are extra characters beyond the end of the formula.


If(
[Available Inventory]<0.5*[Baseline Inventory], "#FFFFCC",
[Available Inventory]<0.5*[Baseline Inventory] and [Raw Material Vendor] ="KT Manufacturing, Inc."),   "#99FFFF", ""
)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
Try this.

If(
[Available Inventory]<0.5*[Baseline Inventory], "#FFFFCC",
[Available Inventory]<0.5*[Baseline Inventory] and [Raw Material Vendor] ="KT Manufacturing, Inc.",   "#99FFFF")
Photo of Suzanne

Suzanne

  • 10 Points
The syntax error is gone, and the rows <50%Baseline Inventory are highlighted FFFFCC, but KT Manufacturing, Inc. is not 99FFFF, it is also FFFFCC
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
can you check the exact spelling and punctuation for KT?  It is likely that your check against that name is spelled differently from how it actually is in your data.

or change the test to be this

If(
[Available Inventory]<0.5*[Baseline Inventory], "#FFFFCC",
[Available Inventory]<0.5*[Baseline Inventory] and Begins([Raw Material Vendor], "KT Manufacturing"),   "#99FFFF")
Photo of Suzanne

Suzanne

  • 10 Points
KT is still the same color as other rows
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
Sorry, this fix is obvious (now). you need to check the most specific condition first.


If(
[Available Inventory]<0.5*[Baseline Inventory] and Begins([Raw Material Vendor], "KT Manufacturing"),   "#99FFFF",
[Available Inventory]<0.5*[Baseline Inventory], "#FFFFCC")
Photo of Suzanne

Suzanne

  • 10 Points
Yay, that works thank you soooooo much!!