Joining on multiple conditions
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
My data is as seen below:
Data Source 1:
Account | Country | Code |
10021854156 | Spain | 1010 |
151562 | Spain | 1030 |
12561864545132 | UK | 1020 |
526526346513 | UK | 1030 |
5262563 | Italy | 1030 |
8989856456 | Italy | 1010 |
Data source 2:
Country | Code | Total Cost |
Spain | 1010 | 100 |
UK | 1020 | 50 |
Italy | 1030 | 220 |
Spain | 1020 | 400 |
UK | 1030 | 520 |
Spain | 1030 | 36 |
Italy | 1010 | 225 |
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?
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Are you expecting the result like this?
If you are expecting a different result, please share the expected output.
Many thanks
Shanker V
