Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
i have my sales table loaded in the followin way:
- Sales data (TABLE A)
- concatenation to sales data table (tABLE B)
then there's a LEFT join to antoher table to retrieve value from another table.
My goal is to set a value retrieved from a left join, as default only for the data coming from table B
anyone knows how i can achive this?
Hi Antonio,
Why not perform the left join on Table B and then after that has been done concatenate tables A & B?
Cheers
Andrew
The left join is needed to retrieve values from table A and B, but just for values coming from table B i would like to keep a default value on just one field. By the way with the left join i also take some others value that needs not to be defaulted.
Perhaps like this:
tempData:
LOAD *, 'A' as SourceTable FROM TableA;
CONCATENATE (tempData)
LOAD *, 'B' as SourceTable FROM TableB;
LEFT JOIN (tempData)
LOAD * FROM TableC;
Data:
NOCONCATENATE
LOAD *, If(SourceTable='A', FieldX, 'Default') as FieldY RESIDENT tempData;
DROP TABLE tempData;
DROP FIELDS FieldX, SourceTable;
RENAME FIELD FieldY TO FieldX;