Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Is it possible to read the last two words of a string as a field?
e.g if the string is ABC DEF GHI.xls, then DEF GHI should be stored in a field.
Thanks,
Asma
You can try this may be:
=SubField('ABC DEF GHI', ' ', 2) & ' ' & SubField('ABC DEF GHI', ' ', 3)
Hi Asma,
try
right('ABC DEF GHI',7) as NewField,
and PFA
Cheers,
Ganesh.
Mid(string,Index(string,' ', -2)+1) as NewField
Hie..
SubField(trim(field name),' ',2)&''&SubField(trim(field name),' ',3)
Hope this will help you...
Regards,
Mohammad
right(string,Index(string,' ', 2)) as NewField
Hi Asma,
for a field with an variable number of words in it, the below should work for you (a simple subfield 2 & 3 wouldn't work with a 4 word value )
subfield('ABC DEF GHI JKL', ' ',SubStringCount('ABC DEF GHI JKL',' ')) & ' ' &
subfield('ABC DEF GHI JKL', ' ',SubStringCount('ABC DEF GHI JKL',' ')+1)
hope that helps
Joe
you can also try this: Mid('ABC DEF GHI',FindOneOf('ABC DEF GHI',' *')) as new field;
See below instructions on how to add to script editor
in the script editor add this:
load
Mid(F1,FindOneOf(F1,' *')) as F2;
LOAD * INLINE [
F1
ABC DEF GHI
];