Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

kvijay173
New Contributor III

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?

Tags (1)
1 Solution

Accepted Solutions
mov
Esteemed Contributor III

Re: Extracting from a big line

Try

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

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

5 Replies
mov
Esteemed Contributor III

Re: Extracting from a big line

Try

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

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

balkumarchandel
Valued Contributor II

Re: Extracting from a big line

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

balkumarchandel
Valued Contributor II

Re: Extracting from a big line

PS : the expression is in single line

kvijay173
New Contributor III

Re: Extracting from a big line

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

mov
Esteemed Contributor III

Re: Extracting from a big line

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)

Community Browser