Thanks Harish. With some more trials and inputs from you, I came up with this code and this works as desired: Cat, Subcat, Sales (Positive sales), Returns (negative sales), %Sales, %Return (All grouped by Cat and Subcat)

***Table A (transaction table) renamed as C

---Start

Select B.cat, B.subcat, C.Sales, C.Return,

ROUND(100*Sales/(select Sum(Sales/Return) From A Where Sales/Return > 0),2) As PercentSales,

Round(100*Return/(select Sum(Sales/Return) From A Where Sales/Return < 0),2) as PercentReturn

From

(Select

catcode,

subcatcode,

Round(sum(case when Sales/Return > 0 then Sales/Return end),2) as Sales,

Round(sum(case when Sales/Return < 0 then Sales/Return end),2) as Return

from A Group by catcode, subcatcode) As C LEFT JOIN

B ON

C.catcode = B.catcode AND

C.subcatcode = B.subcatcode

Order by C.catcode, C.subcatcode

---End