
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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 |
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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';


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
...
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).


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if you are looking not LIKE try this
Where not wildMatch(StoreName,'Reliance*')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Brilliant - Thanks - works fine
