Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
D19PAL
Creator II
Creator II

Two if statement conditions on two fields

Hi

 

Data

 

ID, form_ID, text

1,18,1

2,18,null

3,18,1

1,26,50

1,26,51

1,26,null

3,26,50

 

I want an if statement if form_id = 18 and text = 1, and form_id = 26 and form_id = 50 or 51, 1 or 0 per ID

 

In the script.

 

Thanks 

 

6 Replies
jmartineze
Partner - Creator
Partner - Creator

Hello, 

I'm not sure that you want. 

if(form_id = 18 and text = 1,1, if(  form_id = 26 and (text= 50 or text= 51),1,0)) as Flag

 

abhijitnalekar
Specialist II
Specialist II

Hi @D19PAL ,

Try the below expression.

=if(match(form_ID,'18','26')>0 and match(text,'1','50','51')>0,1,0)

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
D19PAL
Creator II
Creator II
Author

I need rows like this

 

I'd,form_id,text,form_id,text,flag

1,18,1,26,50,1

1,17,1,26,50,0

2,18,1,26,50 1

2,18,1,26,51,1

2,18,1,26,44,0

 

Thanks

D19PAL
Creator II
Creator II
Author

Sorry, look below what I need.

D19PAL
Creator II
Creator II
Author

I tried something similar, only 1 condition works not both.

26, 50 works

26, 51 works

18, 1 no working 

 

D19PAL
Creator II
Creator II
Author

Anyone figured it out?