Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to merge 2 resident tables ?

Hi everyone,

In my model, there are 2 tables which are linked on a common field.  I would like to merge them so I have only one table and then export it into qvd.

I've tried this piece of code :

MergeTable:

LOAD *

resident Table1;

LEFT JOIN

LOAD *

resident Table2

;

But it doesn't work, I still have the 2 tables in my model.

What do I have to do ?

Thanks

1 Solution

Accepted Solutions
fernando_tonial
Partner - Specialist
Partner - Specialist

Hi Laura,

Try this.

Noconcatenate

MergeTable:

LOAD *

resident Table1;

LEFT JOIN (MergeTable)

LOAD *

resident Table2;

Drop Table Table1, Table2;

Best Regards.

Tonial.

Don't Worry, be Qlik.

View solution in original post

10 Replies
Not applicable
Author

Hi Laura,

You need to drop the two residents tables e.g.

Drop Tables Table1, Table 2;

richard_chilvers
Specialist
Specialist

Hi Laura

Does MergeTable end up with the whole of the merged data.

If so, remember to DROP TABLE Table2, so that it is removed from your model.

Hope that helps.

Not applicable
Author

Thanks for your help.

I have added : drop tables Table1, Table2   but then I lose my tables and still don't get the merged table

Could it come from the fact that I renamed fields in when I first load the resident tables ? I mean I have :

Table1:

Load

field1 as key,

field2

FROM ....  (qvd);

Table2 :

Load

F1 as key,

F2

FROM ... (qvd);

But I don't think so because when I don't try to join them, the link is done by qlikview.

Any other ideas ?

Anonymous
Not applicable
Author

Hi,

MergeTable:

LOAD *

resident Table1;

join

LOAD *

resident Table2;

DROP Table Table1,Table2;

STORE MergeTable into ..\QVD\MergeTable.qvd;

Regards

Neetha

JonnyPoole
Employee
Employee

You  can try being explicit in the joining as follows. It should definitely work if they have common field names.  Then as before, drop Table1 and Table2.

MergeTable:

LOAD *

resident Table1;

LEFT JOIN (MergeTable)

LOAD *

resident Table2

fernando_tonial
Partner - Specialist
Partner - Specialist

Hi Laura,

Try this.

Noconcatenate

MergeTable:

LOAD *

resident Table1;

LEFT JOIN (MergeTable)

LOAD *

resident Table2;

Drop Table Table1, Table2;

Best Regards.

Tonial.

Don't Worry, be Qlik.
Not applicable
Author

Hi Laura,

You should try smthing like;

Table1:

Load

......;
Table2:

Load

......;

Merge_Table:

Load

......Resident Table1

Left Join(Merge_Table)

Load

.......Resident Table2;

Drop Tables Table1, Table2;

Hope it helps !

Cheers !

JonnyPoole
Employee
Employee

Almost certainly its because you are auto concatenating . See post above ... are you sure 'noconcatenate' is used immediately above the 'MergedTable:' line ?

Not applicable
Author

Thank you Fernando !! That's it ! There was no "noconcatenate".

Have a great day everyone !