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

Concatenate Tables

I have two tables, from File 1 and File 2, with the same columns. They are currently concatenated into the same table.

However, I would also like to add a column with a 0 or 1 value to distinguish those from File1 and from File2. Any help with this would also be much appreciated.

Thanks very much!!

1 Solution

Accepted Solutions
OmarBenSalem

TableFinale:

load

*, 'Table1' as NewField

From sourceTable1;

concatenante // or don't, they automatically be

load

*, 'Table2' as NewField

From sourceTable2;

With that, we create a new field in each table to distinguish.

Hope this helps

View solution in original post

4 Replies
jrepucci15
Creator
Creator

What loads are you trying to concatenate?  You show three loads, but only one table name and there are no concatenate keywords in the 2nd / 3rd loads.

It appears you are missing a FROM statement for table Fruits1

There is a double comma following [Name1]

To distinguish the different source files, I typically add a statement to each load such as this:

'Fruits1"     AS Source,

'File1'     AS Source,

'File2'     AS Source

OmarBenSalem

TableFinale:

load

*, 'Table1' as NewField

From sourceTable1;

concatenante // or don't, they automatically be

load

*, 'Table2' as NewField

From sourceTable2;

With that, we create a new field in each table to distinguish.

Hope this helps

Not applicable
Author

Hi Omar,

How would i make the new field in each table in order to distinguish them? I would like to be able to put a 0 vs a 1 to distinguish rows in file1 from file2

OmarBenSalem

0 is rows from table 1 and 1 are rows from table 2?

TableFinale:

load

*, '0' as NewField

From sourceTable1;

concatenante // or don't, they automatically be

load

*, '1' as NewField

From sourceTable2;