Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Andy Uttley, Alteryx ACE, makes music with Alteryx | Math + Music
SOLVED

Creating dummy variables

Highlighted
5 - Atom

How can I easily create dummy variables for a given Field?

 

For example, let's say a Field Category has the unique values of x,y and z. I want to create dummy_x, dummy_y and dummy_z with values of 1 or 0 based on the Category field. Now, I have more than 3 unique values and it is difficult to create the dummy variables one by one. 

 

Is there a way to dynamically create the dummy variables based on the values of a particular field?

Highlighted
9 - Comet
Hi Rajesh, Can you please some tabular example what is the as-is/source and what the output would look like? Thanks, Rohit
Highlighted
16 - Nebula
16 - Nebula

Yes you can create dummy for each.

 

The easiest way I can think of is to use a transpose to put all the fields you want to create as rows.

You can then use a formula tool to make a dummy column name.

Then use a cross tab to make it column based.

After this you can use a MultiField formula tool to fill in the nulls.

2016-10-06_09-30-10.jpg

Sample attached

 

 

Highlighted
5 - Atom

Thanks, that worked well.

 

CrossTab with the boolean Field added is what I was looking for. 

Highlighted
5 - Atom

Hi, please could you share what the workflow looks like for the crosstab + boolean field you mentioned?

Highlighted
5 - Atom

Ignore, it is in 

Highlighted
5 - Atom

Similar to Nebula's method but slightly straight forward.

Make Dummys_SK.PNG

Labels