I want little help again.
I have a field (1,2,3 values) that i have done it group by so i take something like that

1 Thomas test 40
2 thomas test2 30

1.thomas test 23
2.thomas test 35

Total sum: income:70- spend:58

*Now i have done all the above but i cant do the last row. I dont know what field to put and how i can sum my groups above

I create a formula field and i have done something like that.

shared numbervar rtTotal;

if({Emp016.PelProm}="1") Then
rtTotal:=rtTotal+Sum ({Emp016.SynTeliko})

where the field pelprom is the field i group by and take values (1,2,3) and the field synteliko is the field with ammounds.

Now i want to get that at the end of report and not at the end of every group

Incomes: (sum of group with value 1)
Spends: (Sum of group with value 2)
Storesum of group with value 3)
Total: Incomes-Spends-Store

So at the end i want 4 new fields but i dont know how to do it...Any help?