Operand Error

Altair Forum User
Altair Forum User
Altair Employee
edited August 2018 in Community Q&A

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

image

 

 

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)))))

Tagged:

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2018

    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.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2018

    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.

    "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.

     

     

    image