Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Parse Name from String

Hello everyone. I need a little help extracting a name from a text string (Active Directory DN). Here are a couple of examples.

I have: CN=Flintstone\, Fred,OU=Users,OU=Bedrock,OU=Enterprise,DC=na,DC=company,DC=com

I need: Flintstone, Fred

I have: CN=Jackson\, Samual L,OU=Users,OU=Hollywood,OU=Enterprise,DC=na,DC=company,DC=com

I need: Jackson, Samual L

1 Solution

Accepted Solutions
Not applicable
Author

You can use Replace (your result, '\', '')



View solution in original post

5 Replies
Not applicable
Author

Something like this:

=MID( YOUR_DIMENSION_NAME, 1, index( YOUR_DIMENSION_NAME, 'OU' ) )

Not applicable
Author

First, index( YOUR_DIMENSION_NAME, 'OU' ), you take a position fisrt OU....

Second you take a piece, start at 1 position of string......and finish before fisrt OU (fisrt expression give this position)

Anonymous
Not applicable
Author

Thanks Erico, that gets me close.

Actually, either of these yeilds the same result:

=MID( UserDN, 4, index( UserDN, ',OU' )-4 )

or

TextBetween(UserDN,'CN=',',OU')

The problem is that both of these still leave the "\" character after the last name: Flintstone\, Fred

Not applicable
Author

You can use Replace (your result, '\', '')



Anonymous
Not applicable
Author

Perfect!

The final answer: Replace(TextBetween(UserDN,'CN=',',OU'),'\','')