Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
abc_18
Creator II
Creator II

How to write multiple if conditions

Hi,

I have a column 'Status' with values from 1 till 10.

I have to implement a condition for this column like below:-

if(status=('1,2,3,5,6,7'),'Open',
if(status=('4,8,10'),'Closed',
if(status=('9'),'Rejected')) as Status_definition, I tried using this but not getting desired output.

Please suggest

Labels (1)
4 Replies
Anil_Babu_Samineni

I would rather use Match() function like. Since you have number's you no need to consider as string. If you have text in status, you hav do draft 'Yes','No' etc.

if(Match(status, 1,2,3,5,6,7),'Open', if(Match(status, 4,8,10),'Closed', if(Match(status, 9),'Rejected'))) as Status_definition

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
martinpohl
Partner - Master
Partner - Master

use

if(match(status,'1','2','3','5','6','7'),'Open',
if(match(status,'4','8','10'),'Closed',
if(status='9','Rejected')) as Status_definition

instead

abc_18
Creator II
Creator II
Author

Thanks Anil

Anil_Babu_Samineni

Please accept correct answer to track this ticket and it will help for community managers to sort out on their DB.

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)