Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Left Join does duplication

Hi.

As i know from sql when you use left join the script goes:

table_A

left Join table_B  on A.id = B.id

in qlikview script i do like this:

Table_A:

....

Left Join (Table_A)

     load *

     resident Table_B

"When i do that it duplicate rows, i guess it's because there is no expression of "on A.id = B.id

?how can i fix it

5 Replies
suzel404
Contributor

Re: Left Join does duplication

Table_B:

LOAD

     *,

     id

FROM Table_B.qvd(qvd);

Table_A:

LOAD

     *,

     id

FROM Table_A.qvd(qvd);

LEFT JOIN (Table_A)

LOAD

     *,

     id

RESIDENT Table_B.qvd(qvd)

DROP Table Table_B;


eduardo_sommer
Valued Contributor

Re: Left Join does duplication

Hi Gil,

You probaly have more than one row in table B corresponding to one row in Table A. The association is done over columns with the same name on the two tables. Check all columns that should match has the same name in both tables.

Eduardo

Not applicable

Re: Left Join does duplication

Hi Gil

Left join shouldn't duplicate if the id is unique

Can you please post a sample it could jut ids

Regards

Padma

satyadev_j
Valued Contributor

Re: Left Join does duplication

Hi,

You may have duplicates in Table B. You may use "Left Keep (Table A)" instead to eliminate duplicate issue.

PS: Left keep will keep two table separate however Table B will have only data which is associate to Table A.

Hope this helps you.

Thanks

fredmanet
New Contributor

Re: Left Join does duplication

Hello,

Load all fields from Table B to see the field who have two values different