Forum Discussion

ElenaLarrabee1's avatar
ElenaLarrabee1
Qrew Captain
8 years ago

I need formula help please:

How do I say "if the value in this field is not blank show me this...? I've been trying to use the not isnull function, but no luck. I'm not sure what I'm doing wrong. This is the formula so far: Case([Inventory Item Name], "", [Edit Price], [Inventory Item Name], IS NOT BLANK/EMPTY [Quantity Proposed]*[Inventory Item - Rental Price Per Unit])

Thank you!!
  • ChrisChris's avatar
    ChrisChris
    Qrew Assistant Captain

    will this work?

    case([inventory item name],"",[Edit Price],if(not isnull([inventory item name])),[Quantity proposed]*...)

    The good ol' IF() is usually the best practice.


  • I'll give it a try! I didn't know I could use the If function within a Case function. 
    • ChrisChris's avatar
      ChrisChris
      Qrew Assistant Captain
      QB will always surprise you one way or the other. I never cease to be.
  • Nope, it's throwing me back an error message. 

    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.

    The function is defined to be If (Boolean condition1, result1, ..., else-result).

    You may need to do one of 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.
    • ChrisChris's avatar
      ChrisChris
      Qrew Assistant Captain

      So, let's go with a full on IF()

      If(

      [Inventory Item Name]="", [Edit Price],

      not isnull([Inventory Item Name]),[Quantity Proposed]*[Inventory Item - Rental Price Per Unit],null

      )


    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      you cannot check for blank like this

      isnull([Inventory Item Name])

      IsNull does not work for text fields.

      You need to use

      IF(Trim([my text field])="", ......, .... )
    • ElenaLarrabee1's avatar
      ElenaLarrabee1
      Qrew Captain
      Hey, seems like it worked! Thank you so much! So I understand that this formula says basically if item name is blank, show edit price, and if it isn't blank, show the result of this math function, what is the final "null" for? Is it just to say that if neither of these options is true then show nothing?