Hi, Rogério. I don't think it is possible to do something like this.
You will have to create a temporary table and use left joint to get apply the values you want.
I think that, in your case, you would have something like this:
Load yearP, monthP, Target
Load yearOp as YearP, monthOP as monthP, sum(Cost)
where Dept = 'Finance'
group by yearOp, monthOp;
left join (Performance)
load * resident tempPerformance;
drop table tempPerformance;
You probably need to correct something in my code before using it...
It's just to give an idea!
Hope it helps
EDIT: Sorry... just corrected the name!
Well, thanks for all the replies. All of them helped me somehow.
But, after some tests, if decided to do it like this:
0 as Target; // from ....
yearP as YearOP,
monthP as monthOP,
0 as Cost,
Target; // from ....
Like this, I only insert rows in the table, and the loading process finishes quickly.