Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.

Labels (1)
1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

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)

View solution in original post

1 Reply
trdandamudi
Master II
Master II

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)