Alteryx Designer Desktop Discussions

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

Joining on multiple conditions

chelsea_bates
5 - Atom

My data is as seen below:

 

Data Source 1:

AccountCountryCode
10021854156Spain1010

151562

Spain

1030
12561864545132UK1020
526526346513UK1030
5262563Italy1030
8989856456Italy1010

 

Data source 2:

 

CountryCodeTotal Cost
Spain1010100

UK

102050
Italy1030220
Spain1020400
UK1030520
Spain103036
Italy1010225

 

I would like to pull in the total cost from data source 2 into data source one but for the right code and the right country (2 conditions).

 

I have used a simply join with code and then country but it is not assigning the right country for some reason. 

 

Please could someone assist?

2 REPLIES 2
cjaneczko
13 - Pulsar

One way to do this is create a field that concatenates the Country and Code. Use a formula tool 

 

 

[Country] + [Code]

 

 

 Insert this into both Data sources and join on that. Uncheck it after the join so it doesnt display in the final results. 

 

The other is to add the second condition to the join. Make sure the Data types in both data sets are the same. If for some reason the Code is Double in one of them and String in the other, it wont join properly. 

 

cjaneczko_0-1684846449565.png

 

ShankerV
17 - Castor

Hi @chelsea_bates 

 

Are you expecting the result like this?

 

ShankerV_0-1684846211247.png

 

If you are expecting a different result, please share the expected output.

 

Many thanks

Shanker V

Labels
Top Solution Authors