Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

pascos88
Contributor II

extract a string between 2 specific character

iDear Expert, 

do you know if there is a way to extract a string between two specific characters? 

row1 : ' year=2017, name=Peter, surname=Jon,  address= herenstrasse ' 

row2 : ' surname=Dario, name=Andrea , address= boundstrasse

I would like to extract for instance all the surname in my table. The order or the data in the string can be casual

Thanks for any helps 

 

 

 

1 Solution

Accepted Solutions
Highlighted
Frank_Hartmann
Honored Contributor

Re: extract a string between 2 specific character

try this:

textbetween(YourFieldName,'surname=',',') as Surname

2 Replies
Highlighted
Frank_Hartmann
Honored Contributor

Re: extract a string between 2 specific character

try this:

textbetween(YourFieldName,'surname=',',') as Surname

mdmukramali
Valued Contributor III

Re: extract a string between 2 specific character

Hi,

can you try something like this:

=SubField( Mid(YourField,Index(YourField, 'surname')+8) ,',',1)
example:

=SubField( Mid('year=2017, name=Peter, surname=Jon, address= herenstrasse',Index('year=2017, name=Peter, surname=Jon, address= herenstrasse', 'surname')+8) ,',',1)

2.

=SubField( Mid('year=2017, name=Peter, surname=Jon, address= herenstrasse',Index('year=2017, name=Peter, surname=Jon, address= herenstrasse', 'surname')+8) ,',',1)


Thanks,
Mohammed Mukram