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: 
anuradhaa
Partner - Creator II
Partner - Creator II

Concatenate Two tables

I have below syntax and i want to concatinate tables P1,P2 ... and build Final table and drop all P1,P2 tables.

So i used below syntax. Here when i create P1,P2 .. tables i used Table(x ; x=1,2,..) tables and drop it after creating the table.

But i after using below syntax i don't have any data. what idid i do wrong

Table1:

LOAD If(Len(Trim(Deadline)) = 0, Alt(Peek('Flag'), 1), RangeSum(Peek('Flag'), 1)) as Flag, 

     Id,

     'P1' as PRODUCT,

     Title,

     Labels,    

FROM

[Data.xlsx]

(ooxml, embedded labels, table is Sheet1$);

[P1]:

NoConcatenate

LOAD

     Id,

     PRODUCT,

     Title,

     Labels,     

If(Len(Trim(Deadline)) = 0, Peek('Deadline'), Deadline) as Deadline

Resident Table1

Order By Flag desc, Deadline;

DROP Table Table1;

Table2:

LOAD If(Len(Trim(Deadline)) = 0, Alt(Peek('Flag'), 1), RangeSum(Peek('Flag'), 1)) as Flag, 

     Id,

     'P2' as PRODUCT,

     Title,

     Labels,    

FROM

[Data1.xlsx]

(ooxml, embedded labels, table is Sheet1$);

[P2]:

NoConcatenate

LOAD

     Id,

     PRODUCT,

     Title,

     Labels,     

If(Len(Trim(Deadline)) = 0, Peek('Deadline'), Deadline) as Deadline

Resident Table2

Order By Flag desc, Deadline;

DROP Table Table2;

[Final]:

Load * Resident P1;

Concatenate

Load * Resident P2;

DROP Table P1;

DROP Table P2;

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try putting two more NoConcatenate with Table2 and Final, like:

...

Table2:

NoConcatenate

LOAD If(Len(Trim(Deadline)) = 0, Alt(Peek('Flag'), 1), RangeSum(Peek('Flag'), 1)) as Flag,

     Id,

     'P2' as PRODUCT,

     Title,

     Labels,   

FROM

[Data1.xlsx]

(ooxml, embedded labels, table is Sheet1$);

...

[Final]:

NoConcatenate

Load * Resident P1;

Concatenate

Load * Resident P2;

....

View solution in original post

3 Replies
manojkulkarni
Partner - Specialist II
Partner - Specialist II

Add a new field  while creating Final Table. something like 1 As FlagFinal. Later you drop this field. This should work

tresesco
MVP
MVP

Try putting two more NoConcatenate with Table2 and Final, like:

...

Table2:

NoConcatenate

LOAD If(Len(Trim(Deadline)) = 0, Alt(Peek('Flag'), 1), RangeSum(Peek('Flag'), 1)) as Flag,

     Id,

     'P2' as PRODUCT,

     Title,

     Labels,   

FROM

[Data1.xlsx]

(ooxml, embedded labels, table is Sheet1$);

...

[Final]:

NoConcatenate

Load * Resident P1;

Concatenate

Load * Resident P2;

....

jagan
Partner - Champion III
Partner - Champion III

Hi,

[Final]:

Load *,

1 AS Dummy

Resident P1;

Concatenate(Final)

Load *,

1 AS Dummy

Resident P2;

DROP Table P1;

DROP Table P2;

DROP FIELD Dummy;

Regards,

jagan.