Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
robin_heijt
Creator
Creator

Concatenating 2 sources

Hi,

As my source data I have 2 files:

Employee report:

IDStatusNameHiring DateGender
1002ActiveJohn24/01/2017Male
8564ActiveRobbert01/08/2018Male
2054ActivePatrick01/01/2017Male
5432WithdrawnLena01/01/2017Female
3245WithdrawnJohnny01/05/2017Male

Movement Report:

IDStatusNameEffective DateMovement Type
1002ActiveJohn20/02/2017Promotion
1002ActiveJohn20/05/2018Promotion
5432ActiveLena20/01/2018Promotion
5432WithdrawnLena20/09/2018Termination
3245WithdrawnJohnny20/03/2018Termination

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:

IDStatusNameEffective DateMovement TypeCycle
1002ActiveJohn--2018-2019
1002ActiveJohn20/02/2017Promotion2016-2017
1002ActiveJohn20/05/2018Promotion2017-2018
2054ActivePatrick--2016-2017
2054ActivePatrick--2017-2018
2054ActivePatrick--2018-2019
5432ActiveLena--2016-2017
5432ActiveLena20/04/2018Promotion2017-2018
5432WithdrawnLena20/09/2018Termination2018-2019
3245ActiveJohhny--2016-2017
3245WithdrawnJohnny20/03/2018Termination2017-2018
8564ActiveRobbert--2018-2019

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;

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;

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!

0 Replies