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 Desktop Discussions

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

Joining multiple columns with one reference column

DigitalPlumberDave
6 - Meteoroid

Hi everyone,

 

I am fairly new to Alteryx - this is my first post - and I need some help joining the below fact and reference tables to produce the third result table:

 

I can produce the result table by joining the fact table to the reference table twice, but was hoping for a more eloquent solution, if available, as the rest of my workflow is already quite big and complex.

 

Fact table

Course_NumberLecturer_CodeTutor_Code
1BB01GG02
2MM05Null
3PP04WW03
4BB01WW03
5SS06FF08

 

Reference table

Educator_CodeEducator_NameEducator_PositionEducator_SpecialtyTenure
BB01Barry BrownLecturerMacro Economics10
GG02Gary GoldTutorEconomics2
MM05Mary MatthewsLecturerAccounting15
PP04Peter ParkerLecturerMicro Economics7
WW03Wendy WhitmanTutorEconomics1
SS06Sally SobersLecturerSecurities5
FF08Frank ForrestTutorFinance2

 

Result table

Course_NumberLecturer_CodeTutor_CodeLecturer_NameLecturer_SpecialtyLecturer_TenureTutor_NameTutor_SpecialtyTutor_Tenure
1BB01GG02Barry BrownMacro Economics10Gary GoldEconomics2
2MM05NullMary MatthewsAccounting15NullNullNull
3PP04WW03Peter ParkerMicro Economics7Wendy WhitmanEconomics1
4BB01WW03Barry BrownMacro Economics10Wendy WhitmanEconomics1
5SS06FF08Sally SobersSecurities5Frank ForrestFinance2

 

I have also tried the solution proposed by @T_Willins in this post:

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Multiple-columns-to-look-up/td-p/62585...

 

The trouble I ran into there was when it came to the Cross Tab step and not being able to choose more than one column (go support this idea if you want to be able to choose more than one column: https://community.alteryx.com/t5/Alteryx-Designer-Ideas/Multiple-Data-Fields-in-Cross-Tab/idi-p/1731). I can probably have multiple cross tabs in parallel, but once again I was hoping for something a bit more eloquent. 

 

Thank you in advance.

3 REPLIES 3
Qiu
20 - Arcturus
20 - Arcturus

@DigitalPlumberDave 
Is this what you need?

If yes, appreciate if you would mark it as acceeptable.1029-DigitalPlumberDave.PNG

T_Willins
14 - Magnetar
14 - Magnetar

Hi @DigitalPlumberDave,

 

In this case since the lecturers and tutor codes are in separate fields, you can just use two Join tools to pull the data together.  The Union tool adds back in the rows that don't have a tutor and a Sort tool puts everything in the right order.

 

Join multiple columns.jpg

 

DigitalPlumberDave
6 - Meteoroid

Thank you both @Qiu and @T_Willins for the prompt responses.

 

In my (inexperienced) view @T_Willins' solutions looks the most elegant so will mark their's as the solution. The incorrect data (Tutor_Specialty and Tutor_Tenure) for course number 5 is my fault for not attaching the sample data - the concept still works a charm.

 

Two joins was also my initial thought, though this is much nicer than what I envisaged.


Labels