🎉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

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

User: "rosie"
New Altair Community Member
Updated by Jocelyn
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

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Marco_Barradas"
    Altair Employee
    Accepted Answer
    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?