OK I am probably missing something so simple here it's not funny but I need help.
What I want to do is add several different transaction types together in one formula.
I have several 'Case When' statements that independently work correctly but now I want to get them to sum together to give me one number.
Here are the case when statements:
case when {transaction.type} = 'Item Receipt' then nvl({transaction.quantity},'0') else 0 end
--
case when {transaction.type} = 'Invoice' then nvl({transaction.quantity},'0') else 0 end
--
case when {transaction.type} = 'Cash Refund' then nvl({transaction.quantity},'0') else 0 end
--
case when {transaction.type} = 'Credit Memo' then nvl({transaction.quantity},'0') else 0 end
--
case when {transaction.type} = 'Inventory Adjustment' then nvl({transaction.quantity},'0') else 0 end
--
case when {transaction.type} = 'Cash Sale' then nvl(-{transaction.quantity},'0') else 0 end
What I am trying to get is
Sum of all item receipts - ((sum of all invoices) - (sum of all cash refunds) - (sum of all credit memo) - (etc) - (etc) - (etc)) = X