Discussions

Expand all | Collapse all

Formula Help

  • 1.  Formula Help

    Posted 01-26-2018 19:20
    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")


  • 2.  RE: Formula Help

    Posted 01-26-2018 19:22
    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)


  • 3.  RE: Formula Help

    Silver
    Contributor
    Posted 01-26-2018 19:23
    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) 


  • 4.  RE: Formula Help

    Top
    Contributor
    Posted 01-26-2018 19:25
    How about this:

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


  • 5.  RE: Formula Help

    Silver
    Contributor
    Posted 01-26-2018 19:26
    How about it? Explain why.


  • 6.  RE: Formula Help

    Top
    Contributor
    Posted 01-26-2018 19:29
    OP>I am trying to write a formula for a new field.

    In the event the OP wanted a text result.


  • 7.  RE: Formula Help

    Posted 01-26-2018 19:31
    ToString is actually not a published Quick Base function.

    It seems to revert to ToText though upon saving.


  • 8.  RE: Formula Help

    Silver
    Contributor
    Posted 01-26-2018 19:32
    Then you have to do some more jazzy stuff when the OP wants to perform math on your text result.


  • 9.  RE: Formula Help

    Top
    Contributor
    Posted 01-26-2018 19:33
    Oops - my bad. I had my Service Worker turned on that converted ToString() to ToText().


  • 10.  RE: Formula Help

    Top
    Contributor
    Posted 01-26-2018 19:37
    It is Magic: ToString() => ToText()