Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have field that include the following data:
Email T , Email B , TRY
TRY, Email T , Email C
Email T
Email C
I want to extract the first place with the word the word "Email" till the next comma and just In case its not "Email T".
In my example I expect to get the following results:
Email T , Email B , TRY -- B
TRY, Email T , Email C -- C
Email T -- Null
Email C -- C
Thanks,
one solution :
Data:
load if(Tmp='Email T',Null(),Tmp) as Tmp2,rowno() as ID,*;
load subfield(Field,',') as Tmp,* inline [
Field
"Email T , Email B , TRY"
"TRY, Email T , Email C"
"Email T"
"Email C"
];
left join
load Field,FirstSortedValue(Tmp2,ID) as New_Field resident Data where len(Tmp2)>0 and wildmatch(Tmp2,'*Email*')>0 group by Field ;
output:
load distinct Field,Replace(New_Field,'Email','') as New_Field resident Data;
drop table Data;
output :
One solution is.
tab1:
LOAD *, SubField(Word,' ',2) As Mailer
Where Word Like 'Email*' And Word <> 'Email T';
LOAD *, Trim(SubField(F1,',')) As Word;
LOAD RecNo() As RowID,* INLINE [
F1
Email T , Email B , TRY
TRY, Email T , Email C
Email T
Email C
](delimiter is '\t');