Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

danielco223
New Contributor III

Extract Name from Column

Hi, I have a dimension called UserDN that has full user names in the column. I am trying to get the user name extracted out into a separate column so it looks like the mock up below. I have used the subfield expression but it comes out as "Smith\,John,OU". Any suggestions would be appreciated.

2-1-2018 9-19-49 AM.jpg

1 Solution

Accepted Solutions
ali_hijazi
Honored Contributor

Re: Extract Name from Column

try:

replace(replace(textbetween(UserDN,'CN=',',OU='),',',''),'\','')

5 Replies
mwoolf
Honored Contributor II

Re: Extract Name from Column

wrap your subfield expression with replace twice. Once to remove "\" and once to remove ",OU"

ali_hijazi
Honored Contributor

Re: Extract Name from Column

try:

replace(replace(textbetween(UserDN,'CN=',',OU='),',',''),'\','')

vvvvvvizard
Contributor III

Re: Extract Name from Column

SubField(Replace( Replace(UserDN,'\',''),'CN=',''),',',1)  &','&

SubField(Replace( Replace(UserDN,'\',''),'CN=',''),',',2)

zebhashmi
Valued Contributor

Re: Extract Name from Column

SubField(Replace(left(UserDN,3),""&Replace(Right(UserDN,25),""&Replace('\,',' ')

or may be this

SubField(Replace(Replace(left(Replace(Right(UserDN,25),' ')),3),' '),'\',' ')



looks like Ali's would work fine just add

replace(replace(textbetween(UserDN,'CN=',',OU=term and contractors'),',',''),'\',' ')

danielco223
New Contributor III

Re: Extract Name from Column

Thank you everyone!