Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
GraysonStack
Contributor II
Contributor II

Linking three tables

Hi. I am relatively new to Qlik. I have three tables: Security, Payroll, and Payroll Positions.

From the Security table I am pulling a user's first name, last name, email address, and Qlik_Role.

-

From the Payroll Table I am grabbing their first name, last name, active status, and position.

-

Inside of the third table, payroll positions, I have two columns that are mapped to each other. The first column is Position/Role, it defines the name of a position. The second column is Qlik_Role. It defines the qlik role associated with the position. (Example: Position/Role = Accounting Clerk | Qlik_Role = Qlik_Role_AccountingStaff).

-

I already have the code I need to get the data from Security and Payroll to map together correctly to grab the status for each user based on a key consisting of first name and last name. So, my question is: How can I use the mapping from the payroll positions file that associates Position/Role with Qlik_Role to link together the Security table and the Payroll table? 

-

For example: I want the final result to compare the Qlik_Role column from the security table to the Position column from the Payroll table and then compare those two to see if they match based on the results from the Payroll Positions table. Essentially linking the three table together and doing a comparison on all three. If you need any more information I can provide! 

Example table:

First Name |                      Last Name             |                Qlik_Role               |                         Position                      |                 Match?              |

    John         |                          Smith                   |            Qlik_Role_GSM       |            General Sales Manager    |                      Yes                 |

Labels (1)
2 Replies
therealdees
Creator III
Creator III

If I understood it correctly, you want to link 3 tables in your data model? If so, you could use a bridge table or you could just join the tables and avoid something more complex.

Would you be able to provide a sample?

 

EDIT: Actually, if one table complements the other, you wouldn't need a common key between all 3, but a 1 by 1 relation.

Ex: Tab1 has a key to Tab2 and Tab2 has a key to Tab3

anat
Master
Master

security:
load first name&last name as Key1,*;
load
first name, last name, email address, Qlik_Role from security;

payroll:
load first name&last name as Key1,active status, position;
load
first name, last name, active status, position from payroll;

payroll_position:
load
Position/Role,Qlik_Role from payroll_position;

as per above security and payroll tables will be linked based on first and last name
then security and payroll_position tables will be linked with Qlik_Role filed