Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Join or Concatenate or Both

I have an issue where we some fact tables all associated around Employee Data.  The tables are Actives, Departures, Transfers.  The data has data in in that is repeated in each.  IE Name, ID, Etc but each table represents different data.

Would the recommended way be to use join or concatenate these all into one table?  Should this all be stacked into one fact table or have fields renamed to avoid the synthetic keys?  Open to suggestions/questions.  Thanks!

Here is sample of my script as it is right now:

Actives:

LOAD *, 'Actives' as SRCTABLE;

SQL SELECT "EMP_ID",

    "EE_NAME",

    "ORG_HIRE_DT",

    "REHIRE_DT",

    "ADJ_HIRE_DT",

    "EE_TYPE",

    "CST_CTR_ID",

    "DPT_NM",

    "JOB_TITLE",

    "JOB_CODE",

    "PSTN_NUM",

    "SUP_ID",

    "SUP_NM",

    BLDG,

    BU,

    "EML_ADDR",

    MAILCODE,

    YYYYMM

FROM BDA.dbo."HR_ACTIVES";

Departures:

LOAD *, 'Departures' as SRCTABLE;

SQL SELECT YYYYMM,

    "EMP_ID",

    "EE_NAME",

    "ORG_HIRE_DT",

    "REHIRE_DT",

    "DEPART_DT",

    "EE_TYPE",

    "CST_CTR_ID",

    "DPT_NM",

    "JOB_TITLE",

    "JOB_CODE",

    "PSTN_NUM",

    "SUP_ID",

    "SUP_NM",

    BLDG,

    BU

FROM BDA.dbo."HR_DEPARTURES";

1 Solution

Accepted Solutions
Not applicable
Author

Hello bill,

You can concatenate the 3 tables (Actives, Departures, Transfers) but also add a flag (name it for example Flag_Table)

and give each table a different flag ( for Actives table "Active" and so on).

Can you upload the qvf you are working on?

Rima

View solution in original post

3 Replies
Not applicable
Author

Hello bill,

You can concatenate the 3 tables (Actives, Departures, Transfers) but also add a flag (name it for example Flag_Table)

and give each table a different flag ( for Actives table "Active" and so on).

Can you upload the qvf you are working on?

Rima

Anonymous
Not applicable
Author

I believe I may have solved this on my own:

Concatenate(Actives)

Load * Resident Departures;

Drop Table Departures;

Anonymous
Not applicable
Author

Thanks for the quick response I figured this out but you were so quick to respond wanted to be sure you got credit:

I used this video to help:  Concatenate Multiple Fact Tables - How to manage the QlikView data model - Part 2 - YouTube