Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have the data like below:
Table:
Load * inline
[
COMPANY
abc corp
ABC CORP
TCP inc
In tcp inc
Google Inc
];
Load *,
if(wildmatch(COMPANY,'ABC','TCP'),'YES','NO') AS DERIVED_COMPANY
Resident Table;
DROP Table Table;
Req: I need capture 'ABC','TCP' from the field COMPANY.That means only capital text.If its CAPS text then i need to show YES else NO
If i select YES in front end only ABC CORP and TCP inc should come.In NO case remaining all.
Plz correct my above formula.
More Thanks,
Ajay
Try this:
Table:
Load * inline
[
COMPANY
abc corp
ABC CORP
TCP inc
In tcp inc
Google Inc
];
Load *,
If(WildMatch(PurgeChar(COMPANY, 'abcdefghijklmnopqrstuvwxyz'),'*ABC*','*TCP*'),'YES','NO') as DERIVED_COMPANY
Resident Table;
DROP Table Table;
Output:
You need to add wild card *:
Load *,
if(wildmatch(COMPANY,'*ABC*','*TCP*'),'YES','NO') AS DERIVED_COMPANY
Resident Table;
edit: Ah, I haven't considered that wildmatch performs case insensitive matching.
Try this:
Table:
Load * inline
[
COMPANY
abc corp
ABC CORP
TCP inc
In tcp inc
Google Inc
];
Load *,
If(WildMatch(PurgeChar(COMPANY, 'abcdefghijklmnopqrstuvwxyz'),'*ABC*','*TCP*'),'YES','NO') as DERIVED_COMPANY
Resident Table;
DROP Table Table;
Output:
Thanks Sun and Swehel
Its working.
Glad we were able to help.
Best,
Sunny