Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 4-5 tables. I want to join each other.
The first three courses, organization, and registrations are linked together by courseid and orgid.
The fourth is linked by hrid.
How do I link the table hr_positions and department as they are not linked to tblcourses but linked to human_resources table?
Qualify*;
tblCourses:
LOAD "COURSE_ID" as CourseId,
DESCRIPTION,
"ORG_ID" as OrgId,
SQL SELECT *
FROM COURSES
where COURSE_TYPE='W';
left join (tblCourses)
LOAD "ORG_ID" as OrgId,
"ORG_NAME",
SQL SELECT *
FROM ORGANISATIONS;
left Join (tblCourses)
LOAD "COURSE_ID" as CourseId,
"HR_ID" as HRID;
SQL SELECT *
FROM REGISTRATIONS;
HUMAN_RESOURCES:
left join (tblCourses)
LOAD "HR_ID" as HRID,
SQL SELECT *
FROM "HUMAN_RESOURCES";
Left join (tblcourses) --- How do I join HRID to above registration table
LOAD "pid" as Pid,
"hr_id" as HRID;
SQL SELECT *
FROM hr_positions;
left join (tblCourses)
LOAD "pid" as pid,
Description,
SQL SELECT *
FROM department;
We keep key field name same in two tables to associate them. We don't need to join them in the script if we don't need to. Qlik manages the joins in the charts during runtime if we have chart fields coming from different tables.
The joining looks okay in your data model view, looks like something is wrong with the keyfield values.
Can you create new field HR_ID1 in the table as shown below, and share the values of it, I want to know why this table ref-dept-hr table values are not associating with the HUMAN_RESOURCES table.
Why do you need to join them? You may keep them separate and associated with the remaining tables using the IDs you got.
What do you mean by associate here? Is it not like joining?
We keep key field name same in two tables to associate them. We don't need to join them in the script if we don't need to. Qlik manages the joins in the charts during runtime if we have chart fields coming from different tables.
Thank You
one question, but when it auto joins, it would be always a inner join. If we have to do left or right or full then?
It won't be inner join, it would be left or right based on how do we sequence our dimensions.
Thank you for your reply.
Somehow, the last 2 are not working properly.
When I join these 2 tables, it is doing the right outer join with the positions table, whereas it needs to be the inner join. Anything wrong with my statements
Qualify*;
LOAD "HR_ID" as HRID,
"HR_TYPE",
SURNAME,
"FULL_NAME";
SQL SELECT *
FROM HUMAN_RESOURCES";
LOAD "hr_id" as HRID ,
"position_id" as PositionId;
SQL SELECT *
FROM Positions
Position id is number(9,0)
Hr_id is varchar(10)
Inner join needs to be explicitly done in the script, any issue in this below? I think after this Human resources and position table will have records for the matching HRIDs only.
Table1:
LOAD "HR_ID" as HRID,
"HR_TYPE",
SURNAME,
"FULL_NAME";
SQL SELECT *
FROM HUMAN_RESOURCES";
Inner Join(Table1)
LOAD "hr_id" as HRID ,
"position_id" as PositionId;
SQL SELECT *
FROM Positions
Unfortunately it is not working