You should use Group by statement.
Load Date as _kMasterCalendarDate,
Triparty_bilateral_ind as subclassification,
sum(Amt_Lcl) as AMT,
bucket as bucket,
Resid_Tnor as RT,
product_group as product_group,
sum(Amt_Lcl*Resid_Tnor) as WAMNumerator
where (classification='Reverse Repo' And Triparty_bilateral_ind='Reverse Repo')
OR (classification='Repo' And Triparty_bilateral_ind='Bilateral repo')
OR (classification='Repo' And Triparty_bilateral_ind='Tri-party repo')
Group by Date,Triparty_bilateral_ind, bucket, Resid_Tnor, product_group ;
First of all, you need a group by for all the non-aggregated values.
Second, second table will auto concatenate into the first, so you will land up double counting everything.
Because of that, its not clear what you are trying to do - perhaps you should explain this in detail if you want accurate and useful assistance.
What exactly do you want to have as a result? As pointed out by others before, you cannot use the SUM expression the way you do in the second load, and that is why you get the error. So it is not the code under the 'resident' that poses the problem, but the code above.
You could use Temp1 to calculate the sums, or you could use a mapping and then map the totals in the Temp1. It depends on your aim.
I have a subclassification field and bucket field with values 1 week, 2week, 1month, 2months, >3months
I want to insert a new bucket value "Total" which has a value of amount for that particular classification or subclassification field.
I can calculate this total by using an expression in pivot table but the thing is bucket if a field which is pivoted to be on top as shown in picture. and If I use an expression in chart, it gives total column for each of bucketvalue. but that is not required actually. the requirement is as above.