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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to join 2 columns and create a single list

Good evening to all!!!

I need to create a single list in table 1, from 2 columns that have different names, from 2 different tables, can someone take a look to the image and give me a hand?

 

Qlik.png

 

Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

You can do this, assuming you can do the check only on the ID field to avoid duplicates.
Table1:
Load
ID1,
Name1
From/resident Table1;

Concatenate (Table1)
Load
ID2 as ID1,
Name2 as Name1
FROM/RESIDENT Table
Where
not exists(ID1, ID2) //only ids that is not already loaded
;

View solution in original post

9 Replies
Anil_Babu_Samineni

Simplify doing this? Flag will help, Which data source it is picking 

T1:
LOAD *, 'T1' as Flag Inline [
ID1, Name1
A, AA
B, AA
C, AA
];

T2:
LOAD ID2 as ID1, Name2 as Name1, 'T2' as Flag Inline [
ID2, Name2
1, 11
2, 22
3, 33
B, AA
];

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Hi, this is an example for bigger tables that contain many more columns, what I need to understand is how to get in table 1 the other lines from table 2

Anonymous
Not applicable
Author

Hi, thank you for your help, what I'm trying to understand is how to get in table 1 the lines / data from table 2 with out getting repeated values in table 1.

This is a ver simple example for a much bigger tables that contains many more columns.

Vegar
MVP
MVP

You can do this, assuming you can do the check only on the ID field to avoid duplicates.
Table1:
Load
ID1,
Name1
From/resident Table1;

Concatenate (Table1)
Load
ID2 as ID1,
Name2 as Name1
FROM/RESIDENT Table
Where
not exists(ID1, ID2) //only ids that is not already loaded
;
Anonymous
Not applicable
Author

It worked perfectly!!!!!!! Thank you very much and sorry for my Spanglish

Anonymous
Not applicable
Author

A small question, and if I'm going to up load table #2 after loading table #1 and make the concatenation, what should I do?
Vegar
MVP
MVP

I don't understand. In my example I'm loading table 2 after table 1. (I notice that the digit 2 disappeared from the code sample)

Anonymous
Not applicable
Author

Hi

On the next image the point where I´m stuck, can you give me a hand with the script and where to add it?

Once again thank you very much!!!Qlik.png

Vegar
MVP
MVP

I posted this on another thread of you, but for future reference Ill copy it into here as well.

Try something like this:

Ventas:
LOAD
...,
... AS VenMes,
... AS VenCodCliente,
... AS VenNomCliente
FROM [Dropbox Ventas Inventarios];

CONCATENATE (Ventas)
LOAD
VenCodCliente,
VenNomCliente
FROM
[Clientes]
WHERE
NOT EXISTS(VenCodCliente, VenCodCliente) //the key for not adding duplicates in the CONCATENATE.
;