Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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!!

Tags (1)
1 Solution

Accepted Solutions
OmarBenSalem
Not applicable

Re: Concatenate Tables

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

4 Replies
jrepucci15
Not applicable

Re: Concatenate Tables

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
Not applicable

Re: Concatenate Tables

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

Re: Concatenate Tables

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
Not applicable

Re: Concatenate Tables

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;