Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
jhlovenc
Contributor

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
Valued Contributor III

Re: IF + AND

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

];

2 Replies
nagaiank
Valued Contributor III

Re: IF + AND

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

];

jhlovenc
Contributor

Re: IF + AND

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

Jonathan

Community Browser