Getting incorrect numbers without the Product code in the table

Working on a Business Objects report in webi 4.3

I have a report that after calculating VAT amounts, calculates the rebate value. This was a set calculation of adding up all the with or without VAT calculations for the total and then multiplying by 0.03 for a 3% rebate. But now in the case of one specific product code, that calculation needs to be multiplying by 0.02 (2%) instead. All the other product codes remain at 3%. I did this with a simple if statement based on the product code.

The report has two tabs, one summary without the product code in and a detail tab that includes the product code. The display of the new rebate calculation is working correctly in the detail tab where the product code is included but in the summary tab, it’s giving me some crazy inflated figures. Does anybody have a way of getting the correct figures in the summary tab. I’ve tried context formulas but hasn’t helped, such as foreach and forall on the product code.

Original 3% calc:
=If([Sales @ 0% VAT]=0;[Sales @ 20% Vat]*0.03;[Sales @ 0% VAT]*0.03)
New calcualtion:
=Sum(If([P Code]=“AIHB608”;If([Sales @ 0% VAT]=0;[Sales @ 20% Vat]*0.02;[Sales @ 0% VAT]*0.02);[Original 3% calc]))

This is the original calcualtion with the numbers you’d expect, so with the clacualtion at everything *3%.

However, when I bring the new calcualtion into the table, the numbers are way higher than they should be? The only difference is one product code should be calculated at 2% instead of 3% so its odd the numbers are so much higher? The new calcualtion brings up the correct numbers in the detail tab.

if the numbers are correct on details-tab, you must insert the product code into your calculation-context,
but pay attention to parentheses for input- and/or output-context !

On the summary tab can you just repeat the details tab report but then suppress the details?