Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Taking dummy column names and create new column

alpro-23
7 - Meteor

Hi everyone. 

 

My problem is to match similar companies and group them together. I've tried fuzzy matching, but it will not work for my current use case. Hence, I am trying another method.

 

As I am new to alteryx, I'm having problem with creating a new column below (highlighted in yellow). I have already transposed my matrix into dummy variables that contain similar words in the 'company' column. Now, all I need to do is to identify the dummies with '1' and append its column name onto the new column.

 

I think it is a simple solution, but I'm really stuck. I've tried multi-field formula, but not sure how I can create a 'new column' with it...

 

Please help!! Thank you.

 

 

alpro23_0-1628767400244.png

 

4 REPLIES 4
mceleavey
17 - Castor
17 - Castor

Hi @alpro-23 ,

 

can you post some data (mock data is fine) and an example of where you are and what you're trying to achieve?

 

Thanks,

 

M.



Bulien

Elias_Nordlinder
11 - Bolide

Hello @alpro-23 ,


I created three different solutions for you below.

 

1. If you already have created the 1's before.

You can first transpose the data.
After this you can filter where the values only are 1 and you will get your desired output.

 

Elias_Nordlinder_4-1628769534420.png

 

 

Elias_Nordlinder_0-1628769421243.png

 

Elias_Nordlinder_1-1628769436188.png

 

 

2. If you do not have the 1's yet but have the column headers.

 

You can first transpose the data.
Create a new flag column where 1 if the original column contains the header.

After this you filter your data where the flag is 1 and you get your desired output.

 

Elias_Nordlinder_5-1628769554275.png

 

 

Elias_Nordlinder_2-1628769462179.png

 

3. If you want to use RegEX and not use Flag/Value at all.

 

Alternatively if all your dummy data looks like below where the desired words are the words of your original column, then you can use Regex_Replace where you only take the first two words.

 

Elias_Nordlinder_6-1628769598163.png

 

Elias_Nordlinder_3-1628769478514.png

 

 

//Regards

Elias

alpro-23
7 - Meteor

Thanks so much. This definitely solves my issue-  and I knew the answer would be really simple! 🙂

Elias_Nordlinder
11 - Bolide

Great, I am happy to hear that! 🙂

Labels
Top Solution Authors