2 Replies Latest reply: Aug 7, 2018 7:59 AM by Vaughn Mitchell RSS

    Operand Error

    Vaughn Mitchell

      When I try to past my formula into a different model I get the operand error.

       

       

      Can someone tell me what I am doing wrong?

       

       

      Code:

       

       

      IF(CodeType = "EDI" .and. Amount >0,Amount,IF(Facility .IN. ('MC.CL','MC.CL2','RV1.CL','WB.CL','WL.CL'),IF(ServiceDate<{1/1/2017},[mcrsd2016]*Qty,IF(ServiceDate>={1/1/2017} .AND. ServiceDate<={12/31/2017},[mcrsd2017]*Qty,IF(ServiceDate>={1/1/2018}, [mcrsd2018]*Qty,.01))),IF(ServiceDate<{1/1/2017},[mcrsdsos2016]*Qty,IF(ServiceDate>={1/1/2017} .and. ServiceDate<={12/31/2017},[mcrsdsos2017]*Qty,if(ServiceDate>={1/1/2018},[mcrsdsos2018]*Qty,.01)))))

        • Re: Operand Error
          Steve Caiels

          Hi Vaughn,

           

          After spending ages trying to check the brackets, I see this is a formula that, I assume, is working in a different model.  That will teach me for not reading the question properly!

          FYI, This is what I got when changing all the If statements to If(Condition,True,False)

          Capture.PNG

          I think the general properties tab has the field type set to character.  Please try and put the entire expression inside quotes :

          "

          IF(CodeType = "EDI" .and. Amount >0,Amount,IF(Facility .IN. ('MC.CL','MC.CL2','RV1.CL','WB.CL','WL.CL'),IF(ServiceDate<{1/1/2017},[mcrsd2016]*Qty,IF(ServiceDate>={1/1/2017} .AND. ServiceDate<={12/31/2017},[mcrsd2017]*Qty,IF(ServiceDate>={1/1/2018}, [mcrsd2018]*Qty,.01))),IF(ServiceDate<{1/1/2017},[mcrsdsos2016]*Qty,IF(ServiceDate>={1/1/2017} .and. ServiceDate<={12/31/2017},[mcrsdsos2017]*Qty,if(ServiceDate>={1/1/2018},[mcrsdsos2018]*Qty,.01)))))

          "


          And see if it will save.  If it does, swap to the general tab, change the field type to Numeric and remove the quotes.


          If it doesn't then it could be one of the other field types.  Please could you check that the ServiceDate is a genuine Date/Time field and the mcrsd2016 (etc) and Qty are numeric.

           

          Regards,

          Steve.

            • Re: Operand Error
              Vaughn Mitchell

              "If it doesn't then it could be one of the other field types.  Please could you check that the ServiceDate is a genuine Date/Time field and the mcrsd2016 (etc) and Qty are numeric."


              This was my problem. ^.^ I needed to change some of the fields to Numeric.


              Thank you. I really appreciate the help.