Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear experts!
Suppose I have loaded a large number of data which carries one field for the name of customers. If I need to pick the records of one customer say K.D.S.Upasena how it could be done. This customer may be recorded in different name formats such as
Mr.Upasena
Upasena
K.D.S.R.Upasena
S.Upasena
S.R.Upasna
Upasena K.D.S.R
etc.
I need this to be written as an expression so that all records with that names should appear in the pivot table I am going to create!
Thanks
Neville
Try this Index(StringField,'Upasena') as a flag field.
Data:
LOAD *,Index(StringField,'Upasena') as FindString;
LOAD * Inline
[
StringField
Mr.Upasena
Upasena
K.D.S.R.Upasena
S.Upasena
S.R.Upasna
Upasena K.D.S.R
];
New:
LOAD *,if(FindString > 0,1,0) as UpasenaNameAvl
Resident Data;
DROP Table Data;
You have to use Wildmatch for this. But the accuracy won't be 100%.
Ex:
if(Wildmatch ([Field],'*Upasena*','*Upasna*') , 1, 0) as Name_Flag
So you want only Names which has K.D.S.R.Upasena or any Upasena?
I need every names with term 'Upasena"
Try like:
Ref Vishnu's expression Try
IF(Wildmatch(CustomerName, '*Upa*'), CustomerName) AS NewCustomerName
Try this Index(StringField,'Upasena') as a flag field.
Data:
LOAD *,Index(StringField,'Upasena') as FindString;
LOAD * Inline
[
StringField
Mr.Upasena
Upasena
K.D.S.R.Upasena
S.Upasena
S.R.Upasna
Upasena K.D.S.R
];
New:
LOAD *,if(FindString > 0,1,0) as UpasenaNameAvl
Resident Data;
DROP Table Data;