Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
arulsettu
Master III
Master III

merging two tables

hi

i have two tables accounts and orders with no common field. now how can i create link between these two tables?

14 Replies
alexandros17
Partner - Champion III
Partner - Champion III

1) Leave them as they are, all combinations will be available in the objects.

2) Join them to obtain a unique table (if tables are big, the join will be slow)

Hope it helps

its_anandrjs

Why you need to link them and but there is no relation between them why you link them otherwise you can concatnate both tables and take it to the single table.

arulsettu
Master III
Master III
Author

can u guys give a example?

alexandros17
Partner - Champion III
Partner - Champion III

If your tables are TAB1 and TAB2:

SELECT * FROM TAB1;

join

SELECT * FROM TAB2;

Remember: this solution gives you all the combination af values from both the tables, concatenation gives you only a table but values from a table will not have values from the other table

its_anandrjs

Write like

Accounts:

Load

*, 'Accounts' as TableFlag

From accounts;

Concatenate(Accounts)

Load

*, 'Orders' as TableFlag

From orders;

Or You can join then also

Accounts:

Load

*, 'Accounts' as TableFlag

From accounts;

Join

Load

*, 'Orders' as TableFlag

From orders;

But if the data is meaning full in both tables then take it into single table if you have sample then provide please.

arulsettu
Master III
Master III
Author

this is accounts table

Capture.PNG.png

this one is orders table

Capture1.PNG.png

using star schema. orders table is fact table. but no common field between two tables

shall i use concat or join?

arulsettu
Master III
Master III
Author

these are the two tables i need to display accounts number and account balance

its_anandrjs

Is there any common date between this two table find that by the common date i believe you can join them and use it in single Order fact table or combination of any two fields also you can join them.

alexandros17
Partner - Champion III
Partner - Champion III

An example:

If you join for each value of Account Number you will have all Customers Id values :

1060     1

1060     41

.... and so on

If you concatenate:

1060     -

1060     -

-          1

-          41