Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Assign label to link if it contains certain text

Dear Community! First of all thank you so much for being so helpful so fast when me and other users have needed help

I have a specific question... So I have a list of links, but I need to be able to add value and separate them from their content.

Lets say I have this:

www.hello.cl

www.thanks.co

www.hi.ar

www.yes.com

I'd like to be able to build something that lets me say that:

IF URL CONTAINS

.CL, IT IS A WEBSITE FROM CHILE

.AR = ARGENTINA

.COM = INTERNATIONAL

Can anybody help me figure this one out?? Do I have to put this in the Load Script? Or can I just add a graph with a long expression?

If it helps, in Excel i solved showing the final bit of the link with this:

=RIGHT(A1,LEN(A1)-FIND(".",A1))

Thanks!

1 Solution

Accepted Solutions
Colin-Albert

The best place is to add this expression in your load script where you load the URL field

load

pick(wildmatch(URL, '*CL', '*AR', '*COM'), 'IT IS A WEBSITE FROM CHILE', 'ARGENTINA', 'INTERNATIONAL') as URL_COUNTRY,

URL,

<more fields here>

from ...

Then you can use URL_COUNTRY as a dimension in your chart and count(URL) as the expression.

View solution in original post

4 Replies
Colin-Albert

pick(wildmatch(URL, '*CL', '*AR', '*COM'), 'IT IS A WEBSITE FROM CHILE', 'ARGENTINA', 'INTERNATIONAL')

Not applicable
Author

And how could I apply this??

I want to make a frequency chart that shows where the site is from and how many links the specific country has.

Colin-Albert

The best place is to add this expression in your load script where you load the URL field

load

pick(wildmatch(URL, '*CL', '*AR', '*COM'), 'IT IS A WEBSITE FROM CHILE', 'ARGENTINA', 'INTERNATIONAL') as URL_COUNTRY,

URL,

<more fields here>

from ...

Then you can use URL_COUNTRY as a dimension in your chart and count(URL) as the expression.

Not applicable
Author

Thank you so much!! It works perfectly 😃 I had no idea about that function!