Hi, I am trying sum up the columns using SUM function ang group by but it is not happening I am attaching dummy data and code I am using cuurently please suugest me solution for the same. code: proc sql; create table demo.unit_capital1 as (select t1.*, (case when (t1.sch_class in ('539','540','541','812','813') and t1.tran_type in ('SWIN','SWINC','UNSAL','UNSALC')) then sum(t1.trades_units) else 0 end) as SHARES_SUBSCRIBED, (case when (t1.sch_class in ('539','540','541','812','813') and t1.tran_type in ('SWOUT','SWOUTC','UNPUR','UNPURC')) then sum(t1.trades_units) else 0 end) as SHARES_REDEEMED, (case when (t1.sch_class in ('539','540','541','812','813') and t1.tran_type in ('SWIN','SWINC','UNSAL','UNSALC')) then sum(t1.Subscription) else 0 end) as Subscription_Money, (case when (t1.sch_class in ('539','540','541','812','813') and t1.tran_type in ('SWOUT','SWOUTC','UNPUR','UNPURC')) then sum(t1.Subscription) else 0 end) as Redemption_Money, (case when (t1.sch_class in ('539','540','541','812','813') and t1.tran_type in ('SWOUT','SWOUTC','UNPUR','UNPURC')) then sum(t1.scheme_load) else 0 end) as Load_ from demo.unit_capital t1 WHERE T1.SCH_CLASS in ('539','540','541','812','813') and t1.upload_date >= '31DEC2015'd group by t1.UPLOAD_DATE,t1.sch_class,t1.tran_type) order by t1.sch_class,t1.tran_type; quit; Thanks,
... View more