Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

donbosco_l
New Contributor

How to trim a string from the middle

I have following.

<a href='http://ssp.rl.gs.com/ssps/-0b83d027-0145-4643-b0c74e70a9e703e&sourceSystemName=PACT2UHA'>"http://ssp.pact-next.url.gs.com/ssps/Current/PACT_Find_eTask?sourceSystemName=PACT2UHA"</a>

I only want the following

http://ssp.rl.gs.com/ssps/-0b83d027-0145-4643-b0c74e70a9e703e&sourceSystemName=PACT2UHA


I tried


   Textbetween([Etask Link], ''',''') but this does not work

This works   :  Textbetween([Etask Link], 'http','PACT2UHA') , However its chops off http and PACT2UHA which I need in the link.


Trimming by length does not work as there are multiple rows with different length. and the string that I am interested in all the rows always start with http and end with PACT2UHA.

1 Solution

Accepted Solutions
trdandamudi
Honored Contributor

Re: How to trim a string from the middle

Try the below:

Data:
Load * Inline [
Etask Link
<a href='http://ssp.rl.gs.com/ssps/-0b83d027-0145-4643-b0c74e70a9e703e&sourceSystemName=PACT2UHA'>"http://ssp.pact-next.url.gs.com/ssps/Current/PACT_Find_eTask?sourceSystemName=PACT2UHA"</a>
]
;

=Mid(TextBetween([Etask Link],'=','<'),2,Len(TextBetween([Etask Link],'=','<'))-2)

Or

=Mid( [ETask Link],10, Len(TextBetween([ETask Link],'=','<'))-2)

1 Reply
trdandamudi
Honored Contributor

Re: How to trim a string from the middle

Try the below:

Data:
Load * Inline [
Etask Link
<a href='http://ssp.rl.gs.com/ssps/-0b83d027-0145-4643-b0c74e70a9e703e&sourceSystemName=PACT2UHA'>"http://ssp.pact-next.url.gs.com/ssps/Current/PACT_Find_eTask?sourceSystemName=PACT2UHA"</a>
]
;

=Mid(TextBetween([Etask Link],'=','<'),2,Len(TextBetween([Etask Link],'=','<'))-2)

Or

=Mid( [ETask Link],10, Len(TextBetween([ETask Link],'=','<'))-2)