Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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;
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;
....
Add a new field while creating Final Table. something like 1 As FlagFinal. Later you drop this field. This should work
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;
....
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.