Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Cloud Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Cloud.
SOLVED

How to create new columns for each unique value?

Trifacta_Alumni
Alteryx Alumni (Retired)

I am working on a dataset that has a column called Name with some values that are repeated and a column called Values with unique values. I want to create new columns for each unique value in the Name Column and populate those new columns with the corresponding values in the Values common.

2 REPLIES 2
Trifacta_Alumni
Alteryx Alumni (Retired)

Hi Jared!

 

You'll want to use the Valuestocols transform. How this works, is it creates a Boolean indicator column for each of the unique values in a column. I've attached a screenshot below to better show what I mean.

For each value in Spring_Day_A, valuestocols creates a corresponding column where you can customize the value to display if the source column is equal to that value, and a value to display if it is not. In the example above, I have chosen to fill with 'yes' when present, and 'no' when not. I could have also listed the column name in 'Fill when present' and it would have returned 'Wednesday' in the Wednesday column, 'Thursday' in the Thursday column, etc.

 

Hope this helps

Trifacta_Alumni
Alteryx Alumni (Retired)

Great, that's perfect!