Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a requirement where i have around 30 tables and i want to concatenate them.
Some of the column in each table are same.. and i want to create a final concatenated table based on defined structure..
For example : suppose i want to create a final table having column names as
A | B | C | D | E |
---|---|---|---|---|
now there are around 30 tables to be concatenate and form the final table.. let me give two table structure...
Table1:
A | C | D | M |
---|---|---|---|
1 | 1 | 1 | 1 |
Table2:
A | B | C | E | M | N | O | P |
---|---|---|---|---|---|---|---|
2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
for these two table i can simply restrict table column manually..
But looking for a way where i can use some for loop and some condition to load all the tables but pick only desired columns...
hope i am able to clarify my requirement..
please help and let me know if any further clarification required.
Hello,
What about loading one master Table before starting the Loop with all exisiting columns like:
Load null() as A, null() as B, null() as C, .... autogenerate(1);
Then start the Loop
regards
tim
Hi Tim,
That i understand but the problem is how can i automatically remove the undesired column from the table1 and table2
like i want to remove column "M" from table 1 and "E,M,N,O,P" from table 2
i would go the same way and delete undesired colums:
RemoveCols:
LOAD * INLINE [
ColName
C
E
M
N
O
P
];
Load null() as A, null() as B, null() as C, .... autogenerate(1);
For ...
Load 30 Tables
next
For each col in RemoveCols
drop field '$(col)';
next
drop table RemoveCols;
LET col =;
Hi,
maybe one solution might be:
tabTemp:
LOAD * FROM [https://community.qlik.com/thread/235261] (html, codepage is 1252, embedded labels, table is @2);
Concatenate
LOAD * FROM [https://community.qlik.com/thread/235261] (html, codepage is 1252, embedded labels, table is @3);
NoConcatenate
tabResult:
LOAD A, B, C, D, E
Resident tabTemp;
DROP Table tabTemp;
hope this helps
regards
Marco