Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

combine two tables ones live one archive

the data is identical just need to combine the too?

1 Solution

Accepted Solutions
Not applicable
Author

Table:

load field1,

     field2,

fildn,

'Biling' as Type

from ...;

concatenate(Table)

load field1,

     field2,

fildn,

'Biling archive' as Type

from ...;

View solution in original post

9 Replies
Not applicable
Author

Table:

load field1,

     field2,

fildn,

'Biling' as Type

from ...;

concatenate(Table)

load field1,

     field2,

fildn,

'Biling archive' as Type

from ...;

Not applicable
Author

I believe it worked but I am picking up 21,000 more records?

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Robert,

If both tables are truly the same (including case of field names etc.) they will auto-concatenate.  This functionality, whilst useful, can be a bit confusing if you are not expecting it.  To force auto-concatenation you can add fields to make the table the same - or you can just force concatenation, as in Rodrigo's example.  It's always worth adding an identifier, as he has also.

If you are loading from QVD though, be aware that a forced concatenation will break optimised load.  It therefore becomes essential to load the largest (archive?) table first - so that is quick and the other table can load unoptimised.

For more info on optimised loads please see this post:

http://www.quickintelligence.co.uk/qlikview-optimised-qvd-loads/

Steve

Not applicable
Author

the number of records will be Table 1 plus the table 2

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Are there duplicates between the two tables?

You may need to do a WHERE NOT EXISTS, to enable this you will need to have a unique ID to use in the not exists.  If the field is not truly unique rows could be lost that you don't mean to.

The syntax is simply:

LOAD
  fields

FROM table

WHERE NOT EXISTS(IDField);

Hope that helps,

Steve

Not applicable
Author

I had one extra field in the archive table.

Not applicable
Author

Now I get a lot of SYN KEYS

Not applicable
Author

OK I think I got it.....  I copied the fields from the Billing table and pasted into the Billing archive and reloaded WITHOUT the  concatenate and well guess what IT WORKED LOL....Thank you!

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Excellent!  If you wanted the extra field from the billing archive (which you have now removed) just add the following to the billing load:

,

null()  as FieldName

FROM Billing ....

;

Where FieldName is the field that is available in the archive but not in the current table.  This will allow the auto concatenate (and no synthetic keys) without losing a field.

Steve