🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Operand Error

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

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

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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.

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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