Happy 8th birthday to the Maveryx Community! Take a walk down memory lane in our birthday blog, and don't miss out on the awesome birthday present that all Maveryx Community members get to take advantage of!

Alteryx Designer Desktop Discussions

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

Creating dummy variables

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?

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
ACE Emeritus
ACE Emeritus

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.


Sample attached



5 - Atom

Thanks, that worked well.


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

5 - Atom

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

5 - Atom

Ignore, it is in 

5 - Atom

Similar to Nebula's method but slightly straight forward.

Make Dummys_SK.PNG

5 - Atom

Thank you for your solution

20 - Arcturus
20 - Arcturus

 Please also try our new macros from CReW



Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.