Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I am trying to build an employee database. We have 2 types of employees that have data on different tables. I would like to pull specific data for each employee type from the respective tables. The kicker is, I want them to be in one table. For instance, I want "Title" for employee type 1 to come from table 1, but I want Title for Employee Type 2 to come from Table 2. I want them to be pulled into the same column in my sheet.
I named each of the fields from the different tables the same name, but that gives me additional synthetic keys. I already have the employee number as the synthetic key.
I included a diagram of what I am trying to accomplish.
Any suggestions?
Hi, you can create a temporary table concatenating table1 and table2, and if not exists add a EmployeeType for each table, like:
tmpEmployeeAdditionalData:
LOAD ...Fields...
1 as EmployeeType
Resident/From...Table1;
Concatenate (tmpEmployeeAdditionalData)
LOAD ...Fields...
2 as EmployeeType
Resident/From...Table2;
Then you can an inner join with emp_no and emp__type renamed as EmpoyeeType and each employee will only keep the row that merges whit their employee type.