Formula Help. If checkbox is checked I want the result to be [THIS FIELD] if checkbox is not checked i want the result to be [the other field].

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

This is my formula - I'm getting a boolean error and I don't know why.

If([Sampling Full Case]=true,[Actual Case Size verified count/weight],[Sample Size2])


Photo of Krissy

Krissy

  • 100 Points 100 badge 2x thumb

Posted 4 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 67,558 Points 50k badge 2x thumb
Can you post the error message?
Photo of Krissy

Krissy

  • 100 Points 100 badge 2x thumb
"Formula error --bad or missing arguments in function call.  The types of the arguments or the number of arguments supplied do not meet the requirements of the function "if."  You may need to do the following to fix the problem:  Choose the right number and type of arguments.  Use a type conversion function to convert the arguments you are using to the correct type. Choose a different function."

It's a numeric formula and all the fields in the formula are numeric except for the checkbox field.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,558 Points 50k badge 2x thumb
Are you super sure that the two fields [Actual Case Size verified count/weight] are both [Sample Size2] numeric?  Is that the correct field ending in a "2". Maybe you have another field called [Sample Size] that you meant to use?
Photo of Krissy

Krissy

  • 100 Points 100 badge 2x thumb
Actually - sorry.......now that you ask the [Actual Case Size verified count/weight] field is not numeric.  I made that a free form field because some time they will key in the count of the product and the weight of the product as #/#.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,558 Points 50k badge 2x thumb
:)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,558 Points 50k badge 2x thumb
You could make the formula field type to be formula text
f([Sampling Full Case]=true,[Actual Case Size verified count/weight],ToText([Sample Size2]))
Photo of Krissy

Krissy

  • 100 Points 100 badge 2x thumb
Will that allow the result in the field to still be used in a numeric formula for another field
?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,558 Points 50k badge 2x thumb
No.
Photo of Krissy

Krissy

  • 100 Points 100 badge 2x thumb
Bummer....okay, well thank you for the help!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,558 Points 50k badge 2x thumb
You will need to separate the verified count and weight into two fields.  But for display purposes, if that is what your users are used to you can combine them into one  formula text field.

ToText(Actual Case Size verified count])
& " / "
& ToText([Weight])