Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Trim URL string

Hello,

I have a question trimming a URL string in qlik.

For example,

Original URLDesired URL Output
https://www.affordablecollegesonline.org/degrees/mba-programs/#Types-of-Online-MBAsaffordablecollegesonline.org/degrees/mba-programs
https://www.topmanagementdegrees.com/rankings/cheapest-online-mba/topmanagementdegrees.com/rankings/cheapest-online-mba

I want to remove  'https://www.' and the last '/' in the string. Also, if they have '/#' in the string then remove everything after the '/#'. Any suggestions?

Thanks!

11 Replies
johnca
Specialist
Specialist

Hi Joerg,

It's not clear to me what you need based on the truncated URL's you shared. Can you share the full URL's and expected outputs the same way the originator of this thread did?

Regards,

JohnInSD

(aka johncaqc)

jblank
Contributor III
Contributor III

Hello Again,

I believe I got there myself:

=IF(SubStringCount(UrlString,'?')>0,LEFT(SubField(UrlString,'?',1),Len(UrlString)),IF(SubStringCount([GA_ZI_Sessions.DataFromQueryURI_dim_pagePath],'&')>0,LEFT(SubField(UrlString,'&',1),Len(UrlString)),UrlString))

Best Regards

Joerg