Forum Discussion

itimatic's avatar
itimatic
Frequent Visitor
5 years ago
Solved

If else complex statement

Hello! Can anyone help in correcting this if statment? I'm getting error "Token Eof expected"

IF [started_at] = NULL and [done] = NULL and [cancelled] = NULL then "Not started" else IF [started_at] != NULL and [done] = NULL and [cancelled] = NULL then "Ongoing" else IF [cancelled] != NULL then "Cancelled" else "N/A"

4 Replies

  • HotChilli's avatar
    HotChilli
    Icon for Community Champion rankCommunity Champion

    small "if".

    I haven't looked at the logic but fix that first.

      • itimatic's avatar
        itimatic
        Frequent Visitor

        Thanks! A bit better 😁 Now getting the error on NULL. 

  • itimatic's avatar
    itimatic
    Frequent Visitor

    Thanks for your hint,. it worked now. this is the final formula for reference:

    if [started_at] = null and [done] = null and [cancelled] = null then "Not started"
    else if [started_at] <> null and [done] = null and [cancelled] = null then "Ongoing"
    else if [done] <> null then "Completed"
    else if [cancelled] <> null then "Cancelled" else "N/A")