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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Left join query between two already imported tables

I have loaded two tables users (users_id, users_name...) and organizations (organizations_id, organizations_name...) from a postgreSQL database in the editor.

Now I would like to create a table users2 (users_id, users_name, users2_organizations_name, users2_organizations_id) containing the characteristics of the users plus those of the organizations using a simple LEFT JOIN query.

I don't know what to write in the editor for that despite many researches. I would love a bit of help !!

Thanks a lot !

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Basically like this:

UsersWithOrganisationDetails:

SELECT ...user_fields_here... FROM ...user_table...;

LEFT JOIN (UsersWithOrganisationDetails)

SELECT ...organisation_fields_here... FROM ...organisation_table...;


talk is cheap, supply exceeds demand
andrespa
Specialist
Specialist

Hi Victor, you have to have at leat one common field in each table to make any join. The sintaxis would be something like this:

Table1

LOAD

COMMON_FIELD,

users_id,

users_name

FROM [your_db_path]

LEFT JOIN

Table2

LOAD

COMMON_FIELD,

organizations_id,

organizations_name

FROM [your_db_path]

What are your other fields?? Have any common one between tables?

Cheers,

Andrés