Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

extracting a code(of variable length) after a character and before a string

I have URLs like the following that I need to extract the code after the last '/' and before the '-4.html' in the load script

/history/2/52557-4.html   -> want to return 52557

/abc/xyz/11/3-4.html       -> want to return 3

I tried: TextBetween(MyString,'/','-4.html')  and it's returning the text between the first '/' rather than the last.

I also tried: TextBetween(right(MyString,15),'/','-4.html'), but since the code can be variable length, I'm not sure how to not capture other preceding '/' with the right() function.

Appreciate the help.

Thanks.

-Ming

1 Solution

Accepted Solutions
disqr_rm
Partner
Partner

Hi Ming,

Following should do the trick:

TextBetween(URL, '/', '-4', SubStringCount(URL, '/'))

View solution in original post

2 Replies
disqr_rm
Partner
Partner

Hi Ming,

Following should do the trick:

TextBetween(URL, '/', '-4', SubStringCount(URL, '/'))

Not applicable
Author

Thanks Rakesh, that worked perfectly.