I would like insert it in a script in the data load editor.
I need to create the table 2 adding costs. I have the total costs in the row in the table 1.
In the table 2 I need to add cost The total costs (-10) needs to be added 80% to Settore A and 20% to Settore B.
The PL field of the table 2 is for :
PL Settore A = 30 + (80% * (- 10))
PL Settore B = 20 + (20%* (-10))
I have to apply costs only when Settore = A or Settore = B. If Settore = C or other I haven't costs.
The percentage 80% and 20% are constants for Settore = A (80%) and Settore = B (20%) I will specify them in the script or insert in a table.
I have never added or reduced rows in a table. Maybe I need to understand how I can add o reduce rows and calculate new values for the output table.
Can you help me?
Pick(Match(Settore, 'A', 'B'), 0.80, 0.20) as PercAlloc;
LOAD * INLINE [
Left Join (Table)
LOAD PL as PL_New
Where Settore = 'Costs';
(PL + (PL_New*PercAlloc)) as PL
Where Settore <> 'Costs';
DROP Table Table;