Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Create new column grouping data from previous column

ArminL
7 - Meteor

Hi Community,

 

my problem is as follows:

 

I want to create a new column, which groups several strings from a previous column. I guess it works somehow with a nice IF... formula, but since I'm pretty new to alteryx i can't come up with the right one.

 

GenreGenre Group

R&B

Urban
Hip/HopUrban
RapUrban
Hard-RockRock
MetalRock
Soft-RockRock
  

 

See this table as an example. I simply want to create the new column "Genre Group" based on the column "Genre". I'm sure its really basic stuff, just want to take a short cut here with your help :)

 

Thanks in advance

2 REPLIES 2
cmcclellan
14 - Magnetar

I'd use a Formula tool and use the SWITCH function :

 

SWITCH([Genre],[Genre],

"R&B", "Urban",

"Hip/Hop","Urban",

"Rap","Urban",

"Hard-Rock","Rock",

"Metal","Rock",

"Soft-Rock","Rock"
)

 

You can easily add rows as you go :)

danrh
13 - Pulsar

You could also use a Text Input with a Join.  It creates a nice list where you simple enter what genre drops into what group.

 

image.png

Labels
Top Solution Authors