Alteryx Designer Desktop Discussions

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

Conditional joining using key

Adityasa
7 - Meteor

Hi,

 

I have one data set that looks like below:

 

Employee IDFunction

1

Apple
2Ball
3Cat
4Ball
5Cat
6Apple
7Apple

 

There's another data set that looks like this:

 

Employee IDSpecialty
1Sweet
6Sour
9Bitter
21Tasteless
24

Juicy

26Salty

 

I want to add the Column of Specialty to first data set based on matching Employee IDs in the two tables, however only for those Employee IDs that Function as 'Apple'. Some Employee IDs with Function as 'Apple' may not be present in second table (like there's no Employee ID 7 in second table) - in these cases, I want the Specialty to be blank. For Employee IDs with other Functions, I want the Specialty to be blank. So the final output should look like this:

 

Employee IDFunctionSpecialty

1

AppleSweet
2Ball 
3Cat 
4Ball 
5Cat 
6AppleSour
7Apple 

 

Thanks.

3 REPLIES 3
RishiK
Alteryx
Alteryx

@Adityasa I think what you are looking to do is similar to a Right Outer Join like in the attached workflow.

This workflow checks the matches and then applies the Speciality column / value, and brings in the other data.

Let me know if this is what you were trying to produce. 

Adityasa
7 - Meteor

@RishiK 

 

What if the second table is like this? Here, I don't want the workflow to pick up 3 and 4 as sweet and sour respectively. I want them to be blank.

 

 

Employee IDSpecialty
1Sweet
3Sweet
4Sour
6Sour
9Bitter
21Tasteless
24

Juicy

26Salty
Maskell_Rascal
13 - Pulsar

Hi @Adityasa 

 

If the join you are making is more of a one off/specific use, you can use the attached workflow. If not, I'd need to know more about how you're attempting to filter/join the data.

 

This workflow uses an Advanced Join macro that enables you to join datasets based on a formula/condition.

 

Maskell_Rascal_0-1624544886254.png

 

Once I get my desired joins, I do a Find/Replace to attach them to the original data by Employee ID. 

Maskell_Rascal_1-1624544942968.png

 

If this solves your problem please mark answer as correct, otherwise let me know!

 

Cheers!

Phil

Labels