Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
Am trying to get data from 3 different tables and trying to merge everything into a single table, Kindly suggest what should i do
table1:
ColA | Colb | Colc |
A | 1 | 11 |
B | 2 | 22 |
C | 3 | 33 |
D | 4 | 44 |
E | 5 | 55 |
Table2:
ColA | Colb | Colc |
F | 6 | 66 |
G | 7 | 77 |
H | 8 | 88 |
I | 9 | 99 |
J | 10 |
1010 |
table 3:
A | 111 | 121 |
B | 222 | 221 |
C | 333 | 321 |
D | 444 | 421 |
E | 555 | 521 |
F | 666 | 621 |
G | 777 | 721 |
H | 888 | 821 |
And i need final table be like below
final table:
ColA | Colb | Colc | ColD | ColE |
A | 1 | 11 | 111 | 121 |
B | 2 | 22 | 222 | 221 |
C | 3 | 33 | 333 | 321 |
D | 4 | 44 | 444 | 421 |
E | 5 | 55 | 555 | 521 |
F | 6 | 66 | 666 | 621 |
G | 7 | 77 | 777 | 721 |
H | 8 | 88 | 888 | 821 |
Load table1, then concatenate table2 and finally right join table3.
Hi, that looks like a concatenation of the fist two tables and a join with the last.
FinalTable:
LOAD * from/resident Table1;
Concatenate LOAD * from/resident Table2;
Left/inner/outer Join
LOAD * from/resident Table3;
Hi Marco,
but while joining am getting more records. If am having 100 records in table 1 and 100 records in table 2, and 150 from table 3 , am expecting 150 final records, but here am getting more records, like 500
Loading your sample data like this does not show additional records.
tabFinal:
LOAD ColA,
Colb,
Colc
FROM [https://community.qlik.com/t5/App-Development/Getting-values-to-a-table-from-different-sources/m-p/1982179] (html, codepage is 1252, embedded labels, table is @1);
Concatenate (tabFinal)
LOAD ColA,
Colb,
Colc
FROM [https://community.qlik.com/t5/App-Development/Getting-values-to-a-table-from-different-sources/m-p/1982179] (html, codepage is 1252, embedded labels, table is @2);
Right Join (tabFinal)
LOAD @1 as ColA,
@2 as ColD,
@3 as ColE
FROM [https://community.qlik.com/t5/App-Development/Getting-values-to-a-table-from-different-sources/m-p/1982179] (html, codepage is 1252, no labels, table is @3);
Can you post an example that shows this behaviour? Maybe there are multiple rows for the same key in your data thus getting multiplied while joining.
thanks
Marco
Hi @MarcoWedel ,
Thanks for the reply,
Yes we do have a multiple records for the same key, but it has different values in some other column, in that case what should i do.
Thanks,
Gokul
please post one example of those multiple keys and your expected result in this case. thanks