Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

TextBetween

I need to create a column XXX where i should get the Number/text  between the text.

KeepChar(name, '0123456789')  worked for 2 scenarios and i need to apply for the other one too.

id         state         name                                                  XXX

abc        BC       alb - ik me (abc def)(1234)                      1234

abc        BC       alb - ik me (abc def)(1234)                      1234

abc        BC       alb - ik me (1234)                                     1234

abc         BC      alb - ik me (1234)                                      1234

abc       BC       alb - ik me (pittsburgh)                           pittsburgh



Please help me out

1 Solution

Accepted Solutions
Specialist II
Specialist II

Re: TextBetween

check this -

Replace(mid(name, (Index(Trim(name), '(', -1)+1), (Index(trim(name), ')', -1)-1)), ')','')

View solution in original post

4 Replies
Highlighted
Contributor III
Contributor III

Re: TextBetween

hi harsha vardhan use this

purgechar(subfield(name,'(',-1),')') as XXXX,

Specialist II
Specialist II

Re: TextBetween

check this -

Replace(mid(name, (Index(Trim(name), '(', -1)+1), (Index(trim(name), ')', -1)-1)), ')','')

View solution in original post

Highlighted
Contributor II
Contributor II

Re: TextBetween

Thanks Neelam. The logic  worked

Highlighted
MVP
MVP

Re: TextBetween

Since you called your post TextBetween, there is indeed a QV function TextBetween(), so another option could be

TextBetween(name, '(',')',SubStringCount(name,'(')) as newfield