I have a scenario where I have to use CASE and SUM in an CDS VIEW SQL statement and I cannot add net_val to the group by statement. Is there a way to use CASE and SUM together
case when sum( net_val ) < 0 then 'DEBIT'
when sum( net_val ) > 0 then 'CREDIT'
end as DEBIT_CREDIT_STATUS