Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
QuentinZNA
Contributor
Contributor

link multiple columns to one table

Hi everyone, i have a pressing issue I can't find the solution for.

I have two tables;

Table Labstaffing;

- LabstaffingID

- Fullname

Table Sample;

- SampleID

- RequestingLabstaffingID

- RegisteredbyLabstaffingID

- CutbyLabstaffID

 

I want to link the variations of labstaffingID from table "Sample" (requesting, registered & cut) to the LabstaffingID from

the table "Labstaffing". This way I can fill in the "fullname" for these ID's, so I know who performed these actions.

 

Anyone know how to do this?

2 Replies
Saravanan_Desingh

Please try something like this

Sample_Output:
NoConcatenate
LOAD
 SampleID,
 RequestingLabstaffingID,
 RegisteredbyLabstaffingID,
 CutbyLabstaffID
Resident Sample;

Left Join(Sample)
LOAD
 LabstaffingID As RequestingLabstaffingID,
 Fullname
Resident Labstaffing;

 

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You will want to move the *staffingId values from the Sample table into a link table. That will give you the Many-to-one relationship between Sample and LabStaffing. 

LinkTable:
LOAD SampleID, RequestingLabstaffingID, RequestingLabstaffingID as LabstaffingID Resident Sample;
LOAD SampleID, RegisteredbyLabstaffingID, RegisteredbyLabstaffingID as LabstaffingID Resident Sample;
LOAD SampleID, CutbyLabstaffID, CutbyLabstaffID as LabstaffingID Resident Sample;

Drop Fields RequestingLabstaffingID, RegisteredbyLabstaffingID, CutbyLabstaffID From Sample;

-Rob