Alteryx Designer Desktop Discussions

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

Joining two excel column

nazuk
8 - Asteroid

Hello All,

 

So in my current task , i am again stuck in a situation. Thought i am finding it difficult to explain. But let me try using a generic case: here i am joining the two based on column "Occupation"

 

Table 1:                                                                                         

 

F_NameL_NameAgeOccupation
AnnaTeo22Teacher
DianaKoh23Doctor
NazAg45Engineer
appAg45Engineer

 

Table 2 :

 

OccupationHobbies
TeacherCooking
TeacherGardening
EngineerCooking
PilotSinging
DancerDrawing 
SingerPanting

 

Output:

 

F_NameL_NameAgeOccupationHobbies
AnnaTeo22TeacherCooking
NazAg45EngineerCooking

 

So basically in table 1 there are 2 Engineer, while in Table 2 there was just 1 . So i want to match that  for every row in table 1 , is there a corresponding row in table 2 as well. So the count of occurrence should also match in both tables.

 

Can anyone suggest?

 

3 REPLIES 3
grossal
15 - Aurora
15 - Aurora

Hi @nazuk,

 

I am not sure if I got it right, but you basically want to say "check the row number and occupation" and if both are the same in both tables - than match them. You could do this the following way:

 

grossal_0-1586450639176.png

 

Output:

grossal_1-1586450715436.png

 

 

 

Steps:

1) Add RecordID Tools to both Inputs

2) Join everything together

3) Sort to original order

4) Remove RecordID Column (Select Tool)

 

Workflow attached. Let me know what you think.

 

Best

Alex

ggruccio
ACE Emeritus
ACE Emeritus

Hi @nazuk

 

If you truly are looking for only one match from each table, you could use the "Unique" tool on the Field [Occupation] in each table first.  This will only take the first row for each unique value of [Occupation].  Then join both tables on [Occupation].

nazuk
8 - Asteroid

Thanks a lot. It is not exactly the scenario. But i got the trick using record id itself to solve the problem.

 

Using the trick given by you. I ma able to get my desired output!

Labels