Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
MikeJones
Creator
Creator

If Statement within a Calculated Field

Hi, I wish to create a new filed using the Calculated Field for the following in Qlik Sense.  The table I am using has JobStatus, the column MikeStatus is my desired result.  I have been successful when using an If statement for only one  condition e.g. if(JobStatus='Completed','Completed','XXX'), however when I try to introduce more than one condition I get missing parenthesis.

JobStatus Mike Status
Completed Completed
Full Abort Full Abort
Engine Abort Completed
Completed Completed
Gin Abort Completed
Engine Abort Completed
Full Abort Full Abort
Completed Completed
Completed Completed

 

Labels (2)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

You have an extra comma here after 'completed'

 

if(JobStatus='Completed' or JobStatus='Engine Abort','Completed',JobStatus)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

4 Replies
Mark_Little
Luminary
Luminary

Hi @MikeJones 

Can you share your full if statement and there error you are seeing?

What you shared is valid, but i assuming the 'XXX' isn't your else argument.

 

vinieme12
Champion III
Champion III

Can you post the actual script you used?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MikeJones
Creator
Creator
Author

Hi, the script I have tried is if(JobStatus='Completed', or JobStatus='Engine Abort','Completed',JobStatus)

vinieme12
Champion III
Champion III

You have an extra comma here after 'completed'

 

if(JobStatus='Completed' or JobStatus='Engine Abort','Completed',JobStatus)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.