Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
As my source data I have 2 files:
Employee report:
Movement Report:
I would then like to concatenate these 2 tables and create a field that represents the cycle they were part of.
With the desired result being this:
The most important part here is that each person will receive 1 line per cycle.
The field cycle will have to be a calculated or a manual field, as this is not present in any of the source files.
Currently I am doing it with this code:
Employee_Report: LOAD "Global ID", Pers.No. as "Personal ID", "Employee Status", Capitalize("First name"&' '& "Last name") as "Name", "Text" as Gender, Date(Date# (Grp.Entry, 'DD.MM.YYYY'), 'DD/MM/YYYY') as "Original hire date" FROM [***/Employee Report.xlsx] (ooxml, embedded labels, table is Sheet1); Outer Join (Employee_Report) Movement: Load "Personal ID", "Name Movement", "Employee Status", "Effective Date", "Movement Type" Resident Movements; Drop table Movements;
Employee_Report:
LOAD
"Global ID",
Pers.No. as "Personal ID",
"Employee Status",
Capitalize("First name"&' '& "Last name") as "Name",
"Text" as Gender,
Date(Date# (Grp.Entry, 'DD.MM.YYYY'), 'DD/MM/YYYY') as "Original hire date"
FROM [***/Employee Report.xlsx]
(ooxml, embedded labels, table is Sheet1);
Outer Join (Employee_Report)
Movement:
Load
"Personal ID",
"Name Movement",
"Effective Date",
"Movement Type"
Resident Movements;
Drop table Movements;
then as resident:
Load *, YearName("Effective Date", 0, 7) as "Cycle" ; Load "Global ID", "Personal ID", "Employee Status", Name, Gender, "Original hire date", "Effective Date", "Movement Type" Resident Employee_Report; Drop table Employee_Report;
Load *,
YearName("Effective Date", 0, 7) as "Cycle"
;
Name,
Gender,
"Original hire date",
Resident Employee_Report;
Drop table Employee_Report;
What would I have to change or do to get the desired result with every person having 1 line per cycle and their corresponding movement?
Cheers!