Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Creating New column based on Keyword in Another Column

Karthick461
8 - Asteroid

Hi,

I have a column(Col A) which has 25K records. Now I need to create New column(Col B) based on keyword in Col A.

For example , If Col A has *Microsoft* , then all corresponding col B data needs to show 'Microsoft Patch'. Like that I have few set of Keywords with me.

What is the best function to use in this case. And Is there any restrictions of using more Keywords.

Any advice on this please

 

 

8 REPLIES 8
binuacs
20 - Arcturus

@Karthick461 I think find and replace tool would be suitable for this use case

 

binuacs_0-1653995255930.png

 

Karthick461
8 - Asteroid

Thanks for the Idea. but Find and Replace is renaming same column rather than creating new column. Also only that particular word is replacing and remaining characters are coming as it is now. New column should show only the fields which I am creating in Replace column

 

now I am getting output as ,

Col A                                         Col B

Apache HTTPD ISAI               Apache Usage HTTPD ISAI

 

My Replace table has 'Apache' as 'Apache Usage'

 

But Actual Requirement is,

If I have Apache (keyword) in Col A , then my Col B should show only 'Apache Usage'

 

Any thoughts on this

 

Now I am getting oup

binuacs
20 - Arcturus

@Karthick461 you can use the append option in the Find and Replace tool

 

binuacs_0-1654000565222.png

 

Karthick461
8 - Asteroid

Hi @binuacs ,

Thanks for the Answer. we have one last issue. If I have 2 words in search criteria , which is not in sequence. how to achieve that.

 

like Below example, col A has to refer for 'Red Hat' and 'nodejs' words and give output as Redhat Patch

 

Any suitable way to achieve this

 

Karthick461_0-1654084028288.png

 

binuacs
20 - Arcturus

@Karthick461 one option is to mention the keyword seperate along with the keywords

 

binuacs_0-1654087551583.pngbinuacs_1-1654087581349.png

 

Karthick461
8 - Asteroid

@binuacs 

If that column has Redhat and nodejs then it needs to come as 'Redhat Patch'. but if that column has only 'nodejs' it should show as 'Nodejs Patch'.

 

Combination of 2 words needs to show one output ,and only single word needs to show another output

 

Karthick461_0-1654094629945.png

 

 

 

binuacs
20 - Arcturus

@Karthick461 I dont think you can give multiple search conditions in one file like the first example, because here the "Red Hat Computer nodejs" will be considered as one word and search in the file and if it doesnt find any match it will return null. I think this case you need to only mention Red Hat, this will replace as Redhat Patch 

Karthick461
8 - Asteroid

Got it @binuacs . Thanks for your help on this. 

Labels