Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, everyone,
Need help in joining tables, or mapping table for adjust some data. Situation: I am loading main table with a lot of columns from data source (.xls), and need join other (Adjustment) table of two colummns. If the key (ProdId) are in both tables need change Producer meaning in Main table.
Example:
When does a script have to be written for the data to load properly?
This is easier to achieve using a mapping load, though you could join the tables and then make a second load pass to pick out the producer from Adjustment if you so prefer. For mapping:
Adjustment:
Mapping Load ProdId, Producer as Producer_For_Map
From AdjustmentTable;
Main:
Load ProdId, TransDate, QTY, applymap('Adjustment',ProdId,Producer) as Producer
From MainTable;
This is easier to achieve using a mapping load, though you could join the tables and then make a second load pass to pick out the producer from Adjustment if you so prefer. For mapping:
Adjustment:
Mapping Load ProdId, Producer as Producer_For_Map
From AdjustmentTable;
Main:
Load ProdId, TransDate, QTY, applymap('Adjustment',ProdId,Producer) as Producer
From MainTable;
Thank you, it's works