Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
paulm
Contributor III
Contributor III

Findoneof keeping the same value

Hi,

I am using the logic below to strip out the domain from a username e.g. user1\username -> username.  It works fine for the majority of users, but a few have a longer domain, but it only removes the same length as the shorter one rather than being reactive to the different length.

e.g.

lower(right([Authenticated user],findoneof([Authenticated user],'\')+1) ) as [Authenticated user stripped],

user1\username                -> username

longuser1\username          -> ser1\username    

I am using 10SR6 for this project - I cannot see this as a known issue but maybe I have missed something, or is this expected functionality.

Thanks

Paul

1 Solution

Accepted Solutions
tresesco
MVP
MVP

It's not a bug. With your logic, if you use Mid() instead of right(), it works. Try:

lower(Mid([Authenticated user],findoneof([Authenticated user],'\')+1) ) as [Authenticated user stripped],

View solution in original post

6 Replies
Anonymous
Not applicable

WHy don't you try subfield([Authenticated user], '\') ?

tresesco
MVP
MVP

Try with subfield() like:

SubField([Authenticated user] , '\' ,2) as [Authenticated user stripped]

giakoum
Partner - Master II
Partner - Master II

right([Authenticated user],Len(Authenticated user) - index([Authenticated user],'\')) as [Authenticated user stripped]

subfield is a better solution

paulm
Contributor III
Contributor III
Author

Thanks for all the replies. I have changed it to substring, I assume that is the correct result if using findoneof?  Just seemed like a bug to me!

giakoum
Partner - Master II
Partner - Master II

no bug, you did not write it correctly. You need to take the string length minus the findoneof...

tresesco
MVP
MVP

It's not a bug. With your logic, if you use Mid() instead of right(), it works. Try:

lower(Mid([Authenticated user],findoneof([Authenticated user],'\')+1) ) as [Authenticated user stripped],