Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Add multiple field label 'look ups' from a flat file

SHamilton1
5 - Atom

Hi,

 

I have a file with about 150 fields of data (columns) and a row per ID. Some fields contain codes which map to a text label (others don't). I have the text labels in a separate csv file but this is flattened data and all the codes are stacked. Is there anyway of joining the two files and adding the labels as new fields at the end of the original file (see below for a simple example). I am trying to avoid doing 150 separate joins and I am sure there must be a better (much more efficient) way using transpose or another tool but I don't know how.

 

IDGenderColourAge_group
ID_1111
ID_2223
ID_3132

 

FieldNameCodeLabel
Gender1Male
Gender2Female
Colour1Blue
Colour2Pink
Colour3Yellow
AgeGroup1Under 20
AgeGroup220-30
AgeGroup3Over 30

 

IDGenderColourAge_groupGender_LabelColour_LabelAgeGroup_Label
ID_1111MaleBlueUnder 20
ID_2223FemalePinkOver 30
ID_3132MaleYellow20-30
4 REPLIES 4
Emil_Kos
17 - Castor
17 - Castor

Hi,

 

If ID and Code are the same columns you can use simple join tool to join them together but according to your merged table that is not the case as ID_3 should have label over 30.

 

Can you clarify if ID is equal to code? 

SHamilton1
5 - Atom

Hi,

 

No ID is not equal to Code. ID is the unique key for each row of data. ID_3 has an Age_Group code of 2 which maps to '20-30'.

 

I could do individual joins for each of the fields to bring in their respective labels but as there are about 150 fields which need a label bringing in this seems like a long-winded of doing it.

ImadZidan
12 - Quasar

Hello @SHamilton1 ,

 

Have a look at the attached. just an idea.

 

Hope it helps.

 

SHamilton1
5 - Atom

This is perfect thank you!

Labels
Top Solution Authors