Forum Discussion

SarahBurres's avatar
SarahBurres
Qrew Trainee
7 months ago

If statement not working

If(IsNull([Related Order]) & [Type]="Non-conformance Report (NCR)","NCR-"&[Tag]&"-"&If(IsNull([Snapshot]),[Snapshot Override],[Snapshot]),
If(IsNull([Related Order]) & [Type]="Material Problem Report (MPR)","MPR-"&[Tag]&"-"&If(IsNull([Snapshot]),[Snapshot Override],[Snapshot]),
If((not IsNull([Related Order]) & [Type]="Non-conformance Report (NCR)","NCR-"&[Plant Number]&"-"&If(IsNull([Snapshot]),[Snapshot Override],[Snapshot]),
If((not IsNull([Related Order]) & [Type]="Material Problem Report (MPR)","MPR-"&[Plant Number]&"-"&If(IsNull([Snapshot]),[Snapshot Override],[Snapshot]))))))



------------------------------
Sarah Burres
------------------------------

1 Reply

  • The & means concatenation as opposed a logical AND

    Also, unlike Excel, you do not need to nest your IFs.

    also unlike excel you can use spaces  and new lines to make the formula more readable, 

    IF(

    IsNull([Related Order]) AND [Type]="Non-conformance Report (NCR)",

      "NCR-" & [Tag] & "-" & IF(IsNull([Snapshot]),[Snapshot Override],[Snapshot]),

    IsNull([Related Order]) & [Type]="Material Problem Report (MPR)",

      "MPR-" & [Tag] &"-" & IF(IsNull([Snapshot]),[Snapshot Override],[Snapshot]),


    not IsNull([Related Order]) & [Type]="Non-conformance Report (NCR)",

      "NCR-" & [Plant Number] & "-" & IF(IsNull([Snapshot]),[Snapshot Override],[Snapshot]),

    not IsNull([Related Order]) & [Type]="Material Problem Report (MPR)",

      "MPR-" & [Plant Number] & "-" & IF(IsNull([Snapshot]),[Snapshot Override],[Snapshot])



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------