Formula Help

  • 0
  • 1
  • Question
  • Updated 10 months ago
  • Answered
I am trying to write a formula for a new field.

If [ships in 7 days] a formula field is "yes", then display the number in [pallets outbound]
if not, display 0.


here's what I have -- not sure why I am getting an error.


If([Ships within 7 days?] = "yes", [Pallets Outbound],"0")
Photo of Ashley Asante

Ashley Asante

  • 696 Points 500 badge 2x thumb

Posted 10 months ago

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

QuickBaseCoach App Dev./Training, Champion

  • 51,486 Points 50k badge 2x thumb
In suspect that this is a formula numeric field and you are trying to populate text into it.

Try this as I removed the quotes

If([Ships within 7 days?] = "yes", [Pallets Outbound],0)
Photo of Chris

Chris, Champion

  • 4,390 Points 4k badge 2x thumb
The 0 should not be within quotes. Also what data type is [Ships within 7 days] ? If it's a check box then the value would be true. if([Ships within 7 days]=true, [pallets outbound],0) 
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,572 Points 20k badge 2x thumb
How about this:

If([Ships within 7 days?] = "yes", ToString([Pallets Outbound]), "0")
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,572 Points 20k badge 2x thumb
OP>I am trying to write a formula for a new field.

In the event the OP wanted a text result.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,486 Points 50k badge 2x thumb
ToString is actually not a published Quick Base function.

It seems to revert to ToText though upon saving.
Photo of Chris

Chris, Champion

  • 4,390 Points 4k badge 2x thumb
Then you have to do some more jazzy stuff when the OP wants to perform math on your text result.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,572 Points 20k badge 2x thumb
Oops - my bad. I had my Service Worker turned on that converted ToString() to ToText().
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,572 Points 20k badge 2x thumb
It is Magic: ToString() => ToText()