Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Hi Laura,
Try this.
Noconcatenate
MergeTable:
LOAD *
resident Table1;
LEFT JOIN (MergeTable)
LOAD *
resident Table2;
Drop Table Table1, Table2;
Best Regards.
Tonial.
Hi Laura,
You need to drop the two residents tables e.g.
Drop Tables Table1, Table 2;
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.
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 ?
Hi,
MergeTable:
LOAD *
resident Table1;
join
LOAD *
resident Table2;
DROP Table Table1,Table2;
STORE MergeTable into ..\QVD\MergeTable.qvd;
Regards
Neetha
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
Hi Laura,
Try this.
Noconcatenate
MergeTable:
LOAD *
resident Table1;
LEFT JOIN (MergeTable)
LOAD *
resident Table2;
Drop Table Table1, Table2;
Best Regards.
Tonial.
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 !
Almost certainly its because you are auto concatenating . See post above ... are you sure 'noconcatenate' is used immediately above the 'MergedTable:' line ?
Thank you Fernando !! That's it ! There was no "noconcatenate".
Have a great day everyone !