Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Left outer join for multiple tables

Hello Everyone,

Basically am looking for left outer join for multiple tables.

It will be an immense benefit for me if someone resolve the qry posted here. For details you may refer the attached documents. I reached level 1 not able to proceed further. For all of your information the JPG FIILE enclosed is the requirement and other documents are soft copy for the same.

In sql server it is bit easy to get the result

select

  mst_column1,

  mst_column2,

  rep1_column1,

  rep2_column1,

  rep2_column3,

  rep3_column5

from

  master_table,

  rep1_table,

  rep2_table,

  rep3_table

where

  mst_dt = rep1_dt(+)  and

  mst_dt = rep2_dt(+) and

  mst_dt = rep3_dt(+)

Please suggest how to get the same result through Qlik as my I have garbage data with me and data bases are different and servers are also different. So I created this own example....

Thanks all, have a great time.

With best regard

Sadhan Damal.

4 Replies
swuehl
MVP
MVP

What about

mst:

LOAD mst_Dt,

     mst_Desc,

     mst_number,

     mst_product

FROM

mst_Data.xlsx

(ooxml, embedded labels, table is Sheet1);

left join(mst)

LOAD Rep1_Dt as mst_Dt,

     Rep1_Desc

FROM

rep1.xlsx

(ooxml, embedded labels, table is Sheet1);

left join(mst)

LOAD Rep2_Dt as mst_Dt,

     Rep2_Desc

FROM

rep2.xlsx

(ooxml, embedded labels, table is Sheet1);

left join(mst)

LOAD rep3_Dt as mst_Dt,

     rep3_Desc

FROM

rep3.xlsx

(ooxml, embedded labels, table is Sheet1);

mst_Desc mst_Dt mst_number mst_product Rep1_Desc Rep2_Desc rep3_Desc
mst_111/1/20161mst__laksjf  
mst_211/2/20162mst__ggg  
mst_311/3/20163mst__edf  
mst_411/4/20164mst__sadfhgh  
mst_511/5/20165mst__ergbd  
mst_611/6/20166mst__zdxvrt Rep3_6
mst_711/7/20167mst__sdf Rep3_7
mst_811/8/20168mst__xczvrep1_8rep2_8 
mst_911/9/20169mst__xczgrfrhrrep1_9rep2_9 
mst_1011/10/201610mst__sdferrep1_10  
mst_1111/11/201611mst__asdghrep1_11  
mst_1211/12/201612mst__sadgwrep1_12rep2_12Rep3_12
mst_1311/13/201613mst__sadghyrep1_13rep2_13 
mst_1411/14/201614mst__sadfae rep2_14Rep3_14
mst_1511/15/201615mst__asdfyre
Not applicable
Author

Many thanks for your precious time and kindness...

Actually I did like below by R&D....but your give me a conformation for the same.

mst:

LOAD mst_Dt,

     mst_Desc,

     mst_number,

     mst_product

FROM

mst_Data.xlsx

(ooxml, embedded labels, table is Sheet1);

mstv1:

left join(mst)

LOAD Rep1_Dt as mst_Dt,

     Rep1_Desc

FROM

rep1.xlsx

(ooxml, embedded labels, table is Sheet1);

rep2:

LOAD Rep2_Dt as mst_Dt,

     Rep2_Desc

FROM

rep2.xlsx

(ooxml, embedded labels, table is Sheet1);

rep3:

LOAD rep3_Dt as mst_Dt,

     rep3_Desc

FROM

rep3.xlsx

(ooxml, embedded labels, table is Sheet1);

Thanks a ton once again for your help.

Have a nice time ahead !!!

swuehl
MVP
MVP

It seems this code is not joining the rep2 and rep3 tables to the master table, instead keeping them linked by mst_Dt.

Might also work and be a valid solution dependend on what you want to achieve further down the lines.

Not applicable
Author

You are right SIR, the qry posted by you was the right one and it will never fail the left outer join statement.

Thanks once again for your concern.