Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Guys,
im trying to join two Tabels (Table A and B) into one master table.
How to join these tables?
The scripts look likes this:
Master Table:
Master_Temp:
LOAD
FieldA As Name,
FieldB As Date,
FieldC As Hours-Category,
If(FieldC=’A’,FieldD) As A,
If(FieldC='B',FieldD) As B,
If FieldC='C',FieldD) As C,
FROM [lib://DATA_Public/EXPORT.csv]
(txt, codepage is 28591, no labels, delimiter is ';', msq);
Master:
Load
Name,
Date,
Name&'_'&Date As KeyJoin,
Sum(A) as A,
Sum(B) as B,
Sum(C) as C
Resident Report_Temp
Group by Name,Date;
Drop table Master_Temp;
Table A:
TableA_Temp:
LOAD
FieldX As Name2,
FieldY As Date2,
FieldQ As QuantityType
If FieldQ='X',FieldU) As Quantity,
FROM [lib://DATA_Public/EX1.csv]
(txt, codepage is 28591, no labels, delimiter is ';', msq);
TableA:
Load
Name2&'_'&Date2 As KeyJoin,
Name2,
Date2,
Sum(Quantity) as Quantity
Resident TableA_Temp
Group by Name2,Date2;
Drop table TableA_Temp;
Table B:
TableB_Temp:
LOAD
FieldP As Name3,
FieldU As Date3,
FieldW As WeightType
If FieldW='KG',FieldJ) As Weight,
FROM [lib://DATA_Public/EX2.csv]
(txt, codepage is 28591, no labels, delimiter is ';', msq);
TableB:
Load
Name3&'_'&Date3 As KeyJoin,
Name3,
Date3,
Sum(Weight) as Weight
Resident TableB_Temp
Group by Name3,Date3;
Drop table TableB_Temp;
Thanks in advance!!
Add lines with "LEFT JOIN (Master)" directly above the lines with "TableA:" and "TableB:"
Add lines with "LEFT JOIN (Master)" directly above the lines with "TableA:" and "TableB:"
It didnt work....
It says Table 'TableA_Temp' not found
Then you have an error in the script you posted first to begin with.
Or perhaps you placed the LEFT JOIN line before "TableA_Temp:" instead of above "TableA:".
Your right! I placed the the LEFT JOIN line before "TableA_Temp:" instead of "TableA:".
Now it works 🙂 Thanks !!