Discussions

Expand all | Collapse all

I need formula help please:

  • 1.  I need formula help please:

    Posted 03-02-2018 17:19
    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!!


  • 2.  RE: I need formula help please:

    Posted 03-02-2018 17:23

    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.




  • 3.  RE: I need formula help please:

    Posted 03-02-2018 17:25
    I'll give it a try! I didn't know I could use the If function within a Case function. 


  • 4.  RE: I need formula help please:

    Posted 03-02-2018 17:26
    QB will always surprise you one way or the other. I never cease to be.


  • 5.  RE: I need formula help please:

    Posted 03-02-2018 17:26
    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.


  • 6.  RE: I need formula help please:

    Posted 03-02-2018 17:29

    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

    )




  • 7.  RE: I need formula help please:

    Posted 03-02-2018 17:31
    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])="", ......, .... )


  • 8.  RE: I need formula help please:

    Posted 03-02-2018 17:32
    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?