Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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';
...
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).
if you are looking not LIKE try this
Where not wildMatch(StoreName,'Reliance*')
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;
Brilliant - Thanks - works fine