Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a field (@8) which contains user logon names, but they are a mixture of formats. i.e.
NT-DOMAIN\FirstnameLastname
NT-DOMAIN\R_FirstnameLastname
I have used the following to strip out the domain and \ so i just end up with the FirstnameLastname
lower(SubField(@8,'\',2)
this works great for the majority of the logon names but it leaves a few that are :
R_FirstnameLastname.
Can anyone tell me how to also strip out the R_ all in the same expression?
note: R_ is only one, there are other letters too with underscores (so not always R)
Thanks
Hi You can try This
=If(findoneof(@8,'_')>0,Subfield(@8,'_',2),Subfield(@8,'\',2))
either in script or in Expression you can use this
see the attched file
hope this helps
this works.
if(left(@8,12)='NT-DOMAIN\R_',Subfield(@8,'_',2),subfield(@8,'\',2))
NT:
load
if(WildMatch(Result, '*_*'), Right(Result, len(Result) - Index(Result, '_')), Result) as Result,
Name;
load
Name,
SubField(Name,'\',2) as Result
;
load * inline [
Name
NT-DOMAIN\FirstnameLastname
NT-DOMAIN\FirstnameLastname2
NT-DOMAIN\FirstnameLastname3
NT-DOMAIN\R_FirstnameLastname4
NT-DOMAIN\R_FirstnameLastname5
NT-DOMAIN\R_FirstnameLastname6
NT-DOMAIN\R_FirstnameLastname7
NT-DOMAIN\RU_FirstnameLastname8
];
SubField(Replace(YourFieldName,'_','\'),'\',-1)