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: 
Anonymous
Not applicable

IF + AND

How do I combine these two exepressions:

= IF (Wildmatch(address_number, '9*'), 'Not In Service', 'In Service')

= IF (Wildmatch(individual_item_number, 'PRIN*), 'Not Installed', 'Installed')

Into IF both conditions , (Not in Service and Not Installed)  'Not Active', 'Active'  ?

(I do not need to keep either of the original expressions, but they both work alone)

Thanks a bunch, JL

1 Solution

Accepted Solutions
nagaiank
Specialist III
Specialist III

The following script works. There may be other ways of doing this also.

LOAD *,

          If(WildMatch(address_number, '9*')=1, 'Not In Service', 'In Service') as [In Service],

          If(WildMatch(individual_item_number,'PRIN*')=1,'Not Installed','Installed') as Installed,

          If((WildMatch(address_number, '9*')=1) and (WildMatch(individual_item_number,'PRIN*')=1),'Not Active', 'Active') as Active;

LOAD * Inline [

address_number, individual_item_number

1234, ABCD123

9876, ABC2345

2345, PRIN123

9765, PRIN345

];

View solution in original post

2 Replies
nagaiank
Specialist III
Specialist III

The following script works. There may be other ways of doing this also.

LOAD *,

          If(WildMatch(address_number, '9*')=1, 'Not In Service', 'In Service') as [In Service],

          If(WildMatch(individual_item_number,'PRIN*')=1,'Not Installed','Installed') as Installed,

          If((WildMatch(address_number, '9*')=1) and (WildMatch(individual_item_number,'PRIN*')=1),'Not Active', 'Active') as Active;

LOAD * Inline [

address_number, individual_item_number

1234, ABCD123

9876, ABC2345

2345, PRIN123

9765, PRIN345

];

Anonymous
Not applicable
Author

Thnaks - I put it in the load script.  Works great!

Jonathan