The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Error : the function "if" must have 3 arguments but has 2

rosierosie Member Posts: 1 Learner I
I got this error while doing the "generate attributes" for my sentiment analysis. The error is caused by this expression: 

if(Score > 0, "positive", if(Score < 0, "negative", if(Score == 0, "neutral" )))

I hope that anyone can help me to solve this problem. Thank you very much

Best Answer

  • MarcoBarradasMarcoBarradas Administrator, Employee-RapidMiner, RapidMiner Certified Analyst, Member Posts: 272 Unicorn
    Solution Accepted
    Hi @rosie you are missing the last part of the last if

    if(Score > 0, 
    "positive", 
    if(Score < 0, "negative", 
    if(Score == 0, "neutral","" )))

    What happens if the third if is false?
Sign In or Register to comment.