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

Like and not like condition in where clause

HowHi,

I am trying to filter data using Not Like condition in where class, LIKE is working but what would be opposite to it? Here is the condition and can anyone help me on this?

Please find the attachment and below information. It is just a sample data.

  

CallIDVendorIDResponseStoreName
111Reliance
120abc
131Reliancefresh
210abc
211abc
221Reliancedigital
231xyz

LOAD CallID,

    VendorID,

     Response,

     StoreName

FROM

Data.xlsx

(ooxml, embedded labels, table is Sheet1)

Where Response=1 or StoreName like '%Reliance%';

-------------------

How can we use not like case here in where clause?

Thanks in advance,

Raju.

5 Replies
Anil_Babu_Samineni

Try This

Where Response=1 and StoreName like 'Reliance';


If you don't want only Reliance then use this


Where Response=1 and StoreName <> 'Reliance';

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
swuehl
MVP
MVP

...

Where Response=1 or not (StoreName like '%Reliance%');


Maybe you need to use star symbol * as a wildcard in your LOAD statement, though, (in both cases).

arulsettu
Master III
Master III

if you are looking not LIKE try this

Where not wildMatch(StoreName,'Reliance*')

saimahasan
Partner - Creator III
Partner - Creator III

You can try this

test:

LOAD * Inline [

CallID, VendorID, Response, StoreName

1, 1, 1, Reliance

1, 2, 0, abc

1, 3, 1, Reliancefresh

2, 1, 0, abc

2, 1, 1, abc

2, 2, 1, Reliancedigital

2, 3, 1, xyz

];

A:

LOAD CallID,

    VendorID,

     Response,

     StoreName,

     '' as jnk

Resident test

Where WildMatch(StoreName,'Reliance*');

B:

LOAD CallID as CallidB,

    VendorID as VendoridB,

     Response as ResponseB,

     StoreName as ScorenameB,

     '' as jnk1

Resident test

Where not WildMatch(StoreName,'Reliance*');

DROP Table test;

JP3
Contributor
Contributor

Brilliant - Thanks - works fine