community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Identify values within string

Atom

Hello everyone!

 

I am trying to analyse some website content, and I am having a bit trouble finding a solution to what I'm looking for.

 

As a starting point, I have strings of data (site link content) which has different Brand names and volume of pageviews.

 

Step 0 
Page ContentPage Views
Brand 1100
Brand1,Brand2100
Brand1,Brand3,Brand4100
Brand2,Brand3100

 

What I want is to identify what content (brand names) appear within the string of data (site link content) like the below example.

 

Step 1     
Page ContentPage ViewsBrand1Brand2Brand3Brand4
Brand 1100Y   
Brand1,Brand2100YY  
Brand1,Brand3,Brand4100Y YY
Brand2,Brand3100 YY 

 

Finally I want to be able to count the total pageviews in which each brand appeared.

 

Step 2 
Page Content containingPage Views
Brand1300
Brand2200
Brand3200
Brand4100

 

The total number of brands I am trying to analyse is around 100, so I would like to use some reference file for the brand names rather than having to write multiple times "contains Brand1",contains "Brand2"...etc...

 

 

Can someone support? Thanks in advance!

Alteryx
Alteryx

Hi @ariera

 

I think you would want to use the Text to Columns tool and use it to split the Page Content field to rows.

 

Then you can use the Summarize tool to group by the Page Content and sum the Page Views

 

Brand.pngBrand2.png

Atom

Hello Joe,

 

Thanks for the response, much appreciated. Unfortunately, the data in my strings is not as organized as I showed on my example.

 

In my example I showcased it like this:

Step 1 
Page ContentPage Views
Brand 1100
Brand1,Brand2100
Brand1,Brand3,Brand4100
Brand2,Brand3100

 

But the data is in reality much more chaotic, so it actually looks more like the below:

I know what are the variables I need to identify (Brand1, Brand2, BrandN...) but I need to identify them from chaotic and messy data strings.

Step 1 
Page ContentPage Views
www.Brand 1.vs.XYA.example123.com100
www.example123Brand1.vsBrand2.redblue.com100
www.Brand1red.vsBrand3yellowABC/Brand4example.com100
www.ABCBrand2.exampleBrand3/blue.com100

 

Let me know if this makes sense.

 

Cheers,

Anna

Alteryx Partner

Hi @ariera,

 

I don't know how many variables you have, but you might consider the following as an option.

Creating a seperate value for every variable and summarizing just as @JoeS showed.

 

 Sol.PNG

 

Kind regards!

Yalmar

Alteryx
Alteryx

That does make it a bit more complex :-)

 

Do you have the list of brands you are looking for or are you trying to find that information from the string?

 

How many brands is it? The above would work OK assuming it's not a large list, if you do have a bigger list let me know and I can put something together.

Bolide

Hi @ariera

 

The attached package has a macro that should do the job. 

 

Feel free to reach out if you have any questions. 

 

ciao

 

Gavin

Alteryx Everything, Leave no one behind.
Labels