Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Creator
Creator

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
Partner - Specialist
Partner - Specialist

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
Author

Hi Gil

Left join shouldn't duplicate if the id is unique

Can you please post a sample it could jut ids

Regards

Padma

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

Hello,

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