Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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!

Tags (3)
1 Solution

Accepted Solutions

Re: Assign label to link if it contains certain text

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.

4 Replies

Re: Assign label to link if it contains certain text

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

Not applicable

Re: Assign label to link if it contains certain text

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.

Re: Assign label to link if it contains certain text

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

Re: Assign label to link if it contains certain text

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

Community Browser