Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
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

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
Partner

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.

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)