Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

URL Address

Hi,

Please help me with idea.

I have different website' urls like this http://www.name.org/site/lookup.asp?c=9iLOK7PJKfI2G&b=6229577.

I want to keep only name.org.

I replace in load scrypt

Replace(Replace(Replace(Replace(Replace(SITE, 'http://',''),'http:/',''),'http:www.',''),'https://',''), 'www.','')  as ...

I get name.org/site/lookup.asp?c=9iLOK7PJKfI2G&b=6229577

How can I replace or remove other info after org?

Thanks,

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Load *, if(SubStringCount(Tested,'_')>1, Left(Tested,Index(Tested,'_'))&SubField(Client1,'_',2), SubField(Tested,'/',1)&'_'&SubField(Tested,'_',2)) as Client;

Load *,if(SubStringCount(Client1,'_')=2,SubField(Client1,'/',1)&'/_'&SubField(Client1,'_',3), SubField(Client1,'/',1)&'/_'&SubField(Client1,'_',2)) as Tested Resident T1;

I understand that.

Why do you load twice?

View solution in original post

25 Replies
MayilVahanan

Hi

     Use KeepChar('

http://www.name.org/site/lookup.asp?c=9iLOK7PJKfI2G&b=6229577','name.org')

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this

=Left(Replace(URLFieldName, 'http://www.', ''), index(Replace(URLFieldName, 'http://www.', ''), '/')-1)

Hope this helps you.

Regards,

Jagan.

Anonymous
Not applicable
Author

Hi guys,

Your ideas didn't work as I need it.

Please see my url example below

headandqqq.ca/en-CA/index.jspx_049708
headandqqq.co.in/en-IN/index.jspx_051205
headandqqq.com/en-US/index.jspx_049647
headandqqq.com/es-US/index.jspx_049713
helpcer.linkshare.com/publisher_024374

ihotel.com/ihg/hotels/us/en/global/support/meetings_106328

I want to keep everything included domain and _NUMBERS

jagan
Luminary Alumni
Luminary Alumni

Hi,

Can you clearly explain with some example.  Earlier you said that you need only "name.org", so the script which I given works you.

Input:

ihotel.com/ihg/hotels/us/en/global/support/meetings_106328

Output:

ihotel.com/_106328

Is this you require?

Regards,

Jagan.

Anonymous
Not applicable
Author

Sorry for confusing,

Yes,

Input:

ihotel.com/ihg/hotels/us/en/global/support/meetings_106328

Output:

ihotel.com/_106328.

Cheers,

MayilVahanan

Hi

     Try something like this,

     = SubField('ihotel.com/ihg/hotels/us/en/global/support/meetings_106328','/') &'/_'&

SubField('ihotel.com/ihg/hotels/us/en/global/support/meetings_106328','_',2)

     This also give o/p as your requirement

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

It didn't work.

I need to replace all of them.

Different url with differnt numbers at the end.

MayilVahanan

Hi

     Please see the attached file

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

Please see atached file. Your expression works!!!

But I replaced first part. Could you adjust it?

Thanks,