Alteryx Designer Desktop Discussions

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

COUNT HOW MANY TIMES A VALUE Is CONTAINED IN A WORD

Ruizsteve
5 - Atom

Hi, I need help with a formula, I have a column with more than 650K search terms and I need to know how many times each word appears in the column whether is the exact word or is being contained in another word. the following is a small example of how the result should look like.

 

search termoccurrency
iphone9
iphone 121
iphone case2
iphone case 121
iphone 131
iphone 141
iphone pro max 3
iphone pro max case1
iphone pro max 141

 

occurrence is the result i need to get and i have the column search term

 

i would really appreciate your help with this matter. 

 

Steven

3 REPLIES 3
BS_THE_ANALYST
14 - Magnetar

@Ruizsteve I'd use an iterative macro for this. I won't lie, this was a bunch of fun. Thanks for the challenge. I'll attach the workflow (and the macro). Beware, this will take a while as you have 650k records.

 

Input:

BS_THE_ANALYST_0-1680207913202.png


Macro:

BS_THE_ANALYST_1-1680207925410.png

Macro configuration:

BS_THE_ANALYST_2-1680207958434.png


I've configured it to run for 670k. 

Here's what my suggestion is though. On the initial workflow, grab a sample tool, and run it for like 1000. See how long it takes:

BS_THE_ANALYST_3-1680208029160.png

 



 

BS_THE_ANALYST
14 - Magnetar

@Ruizsteve I ran this on a list of 10000. It works at a decent speed. My computer is by no means high-end though!

BS_THE_ANALYST_0-1680213226134.png

1 minute for that.

Don't feed any extra columns into the macro though:
Just use a select tool to only take in the search term column. 

BS_THE_ANALYST_1-1680213311861.png


Let me know how it goes!

 

Qiu
21 - Polaris
21 - Polaris

@Ruizsteve 
I agree with @BS_THE_ANALYST , this would an expensive calculation.

I tried to reduce the append tool which hope can be a bit faster.

0331-Ruizsteve-B.PNG0331-Ruizsteve-A.PNG

Labels