Seal Report Forum
»
Report Edition
»
Reports
»
How to sum when value contain negative values
Rank: Member
Groups: Registered
Joined: 4/17/2017(UTC) Posts: 12 Thanks: 6 times
|
***SOLVED***It's lmost as I am to embarrassed... I had a typo which lead it to look in for a wrong key in the table. Sorry guys. Hi, My table have a column called 'PaymentMethod' and 'PurchaseAmount' 'PurchaseAmount' contains positive and negative values. I have setup so far that I get a list of PaymentMethods on row with specifications of each PaymentMethod (cash, invoice, card and refund) and in column two they all are counted. But the problem is that Refund, that only contain negative amounts show correct counted, but the SUM is 0 (should be -5000). How can I set up so this PaymentMethod shows the negative amounts? I've tried to add Custom SQL but just gets errors; sum(case when PurchaseMaster.PurchaseAmount > 0 then PurchaseMaster.PurchaseAmount end) as pos_sum, sum(case when PurchaseMaster.PurchaseAmount < 0 then PurchaseMaster.PurchaseAmount end) as neg_sum and also tried this, it doesn't give error, it just doesn't show the negative amount; SUM(ABS(PurchaseMaster.PurchaseAmount)) Any ideas ? Edited by user Tuesday, April 25, 2017 9:06:03 PM(UTC)
| Reason: Not specified
|
|
|
|
Seal Report Forum
»
Report Edition
»
Reports
»
How to sum when value contain negative values
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.