Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
aashish591
Contributor III
Contributor III

Concatenate tables based on defined structure?

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

ABCDE

now there are around 30 tables to be concatenate and form the final table.. let me give two table structure...

Table1:

ACDM
1111

Table2:

ABCEMNOP
22222222

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.

4 Replies
zhadrakas
Specialist II
Specialist II

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

aashish591
Contributor III
Contributor III
Author

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

zhadrakas
Specialist II
Specialist II

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 =;

MarcoWedel

Hi,

maybe one solution might be:

QlikCommunity_Thread_235261_Pic1.JPG

QlikCommunity_Thread_235261_Pic2.JPG

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