Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load one string but not the other

I only want to load Companies with strings containing Sears but not Companies with strings containing Sears and Lowes or just Lowes.  Can you help?

 

DryerDetails:

LOAD * INLINE [

Dryer Model,                    Cost,                      Companies

NED4655EW,                     $398,                     Home Depot Lowes Sears            

WED5000DW,                    $498,                     P.C. Richard & Son Sears

MEDC465HW,                    $498,                     Lowes P.C. Richard & Son

DVE50M7450P,                 $598,                     Sears Lowes

DVE52M7750W,                $999,                     Sears P.C. Richard & Son Home Depot

];

Where WildMatch([Companies],'*Sears*' );

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be:

Where WildMatch([Companies],'*Sears*' ) and NOT WildMatch([Companies],'*Lowes*' );

View solution in original post

2 Replies
laksyelugoti
Contributor II
Contributor II

One option is using 2nd Resident load, below is sample code..
1. First load all companies with 'Sears'
2. From above records, Filter out 'Sears' companies with 'Lowes'

DryerDetails_all_Sears:
noconcatenate
Load *
Resident DryerDetails
wildmatch(Companies,'Sears') << Load all companies with 'Sears'

DryerDetails_Final:
noconcatenate
LOAD * Resident DryerDetails_all_sears
NOT wildmatch(Companies,'Lowes') << Load all companies with 'Sears' without 'Lowes'

tresesco
MVP
MVP

May be:

Where WildMatch([Companies],'*Sears*' ) and NOT WildMatch([Companies],'*Lowes*' );