Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Error Merging Two Tables with Exactly the Same Fields

Hi,

I have been struggling to merge two tables containing exactly the same fields.  The Implicit merging (concatenation) of the tables are not taking place.

Tables are derived from different sources, but contain exactly the same fields.  Tables (REFDOC_106 and REFDOC)

Please see below for table view.

asdf.PNG

Could anyone please help point me in the right direction?  The tables have been created themselves, in other words there has been joins used previously in order to obtain the final product which are these tables. Could that possibly have an effect?

Thanks in advance.

7 Replies
Highlighted
Champion III
Champion III

Did you use CONCATENATE keyword between these tables?

Table1:

LOAD * FROM XYZTablename;

CONCATENATE

Table2:

LOAD * FROM ABCTablename;

Highlighted
Creator III
Creator III

I tried the below.  However, no tables remained.  Thus, table 1 concatenated with the refdoc etc.

Table1:

LOAD * Resident REFDOC;

DROP TABLE REFDOC;

CONCATENATE

Table2:

LOAD * Resident REFDOC_106;

DROP TABLE REFDOC_106

This didnt work, seems implicit concatenation resulted in Table 1 merging with refdoc and table 2 merging with redoc106 before i dropped them.

Without the drop statements it gives exactly the same result as the first screenshot i posted.  Any idea what this means?

Highlighted
Specialist III
Specialist III

Hi,

As you said Table1 is merging with REFDOC table so what I would do is to add a new column, a dummy column so that Table1 and Table2 don't get concatenated to the original tables:

Table1:

LOAD *, 'Table1' As [Table ID] Resident REFDOC;

DROP TABLE REFDOC;

Concatenate(Table1)

Table2:

LOAD *, 'Table2' As [Table ID] Resident REFDOC_106;

DROP TABLE REFDOC_106;

Hope this helps

Highlighted
Champion III
Champion III

Does REFDOC and REFDOC_106 tables have same number of fields and field names ?

If they have, why you want to do a resident you can directly use Concatenate between both like

LOAD * FROM REFDOC;

CONCATENATE

LOAD * FROM REFDOC_106;

Just wondering what resident load is used for here?

Highlighted
Creator III
Creator III

That was the answer, thank you very much !

Highlighted

If you do not want to create new columns that you maybe won't use later on anyway, add the prefix NOCONCATENATE to the Table1 LOAD statement. That prefix will inhibit the Table1 LOAD from concatenating all rows to REFDOC.

Whenever you make a simple copy of one resident table, pay attention to where the copy ends up. QlikView may decide to perform an unexpected AUTOCONCATENATE, even when you name the copy differently. That's one of those things...

Peter.