Forum Discussion

newpbiuser01's avatar
newpbiuser01
Helper V
3 years ago
Solved

Merging and Appending Data Tables

Hello,

 

I am trying to merge and append data from two tables where the first one has an employee name, ID and their travel to and from information. The second table has the employee location - city and country. This location has no bearing on the  To and From country data. 

Travel Data:

NameIDDepartmentToFrom
Bob1SalesCAUS
Bob1SalesUS 
Andy2MarketingCAUK

 

Employee Location:

Name CityCountry
Bob1LondonUnited Kingdom
Bob1BrisbaneAustralia
Bob1New DelhiIndia
Bob1BerlinGermany
Andy2BostonUnited States
Andy2ParisFrance

 

The resulting table should merge the Travel and the Employee location data and Travel Data and if needed add rows for each employee as needed:

NameIDDepartmentToFromCityCountry
Bob1SalesCAUSLondonUnited Kingdom
Bob1SalesUS BrisbaneAustralia
Bob1Sales  New DelhiIndia
Bob1Sales  BerlinGermany
Andy2MarketingCAUKBostonUnited States
Andy2Marketing  ParisFrance

 

I am able to merge the data, but I can't add the new rows where the country to and from fields remain blank for the newly added rows. Would anyone know how I could do this?

 

Thank you for your help!

2 Replies