Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Extracting from a big line

CN=Vijay Kumar,OU=Standard,OU=Users,OU=Madras,OU=Sites,OU=iWay,DC=ap,DC=corp

Hi Friends,

In the above line we multiple OU=

I would like to extract Madras from OU=Madras.

How can I do this?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Try

TextBetween(BigLine, 'OU=', ',', 3)

Where 3 points to the 3rd occurrence of 'OU='

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Try

TextBetween(BigLine, 'OU=', ',', 3)

Where 3 points to the 3rd occurrence of 'OU='

Anonymous
Not applicable
Author

if it just madras you can use

=mid('CN=Vijay Kumar,OU=Standard,OU=Users,OU=Madras,OU=Sites,OU=iWay,DC=ap,DC=corp' ,index('CN=Vijay Kumar,OU=Standard,OU=Users,OU=Madras,OU=Sites,OU=iWay,DC=ap,DC=corp','OU',3)+3,6)

you may need to apply other string function if you have other states name here .

Thanks

BKC

Anonymous
Not applicable
Author

PS : the expression is in single line

Anonymous
Not applicable
Author

CN=vk1234,OU=Restricted,OU=Users,OU=ABC,OU=Sites,OU=Norm,DC=mx,DC=net
CN=Tony,OU=Admins,OU=Administration,OU=Norm,DC=ru,DC=org

Hi Michael, I am getting the result for the second line but not for the first line. What might be the Issue. I have the column name as adstate

Anonymous
Not applicable
Author

Works for me, returns ABC...  Here is the exact expression:

=TextBetween('CN=vk1234,OU=Restricted,OU=Users,OU=ABC,OU=Sites,OU=Norm,DC=mx,DC=net', 'OU=', ',', 3)