I am making a report using Crystal report. My column data(Amount) is grouped according to id(1 and 2). I want to print difference of total sum of amount according to id(1 and 2).
For eg:-
In group id 1, amount field are:-
100
200
300
And in group id 2 amount fileds are:-
50
150
250
My output in crystal report should be: 1-2
i.e: (100+200+300) - (50+150+250)
Please help me. I have tried doing it through formula field in this way:-
local numbervar x=0;
if({Statement_of_Pay.Pay_Head_Type_Code}=1)
then
x:= x + {Statement_of_Pay.Amount}
else if({Statement_of_Pay.Pay_Head_Type_Code}=2)
then
x:= x - {Statement_of_Pay.Amount}
This is not working the way I want. Kindly help me!