really damn problem with manual summing
Hi all,
ok i have a really have a problem with a report which is hard to explain, cause the report isnt standard and easy (i think).
I have a a manual sum function, cause (i think) the normal sum wont work.
Everytime the first (in screenshot green marked) sum is summed twice, what is wrong.
I cant use the standard sum function for groups. because of the yellow marked rows i cant sum, cause from the yellow rows i only need the min().
The second reason, because i need the sum manual (function) is..
The left col und the right col need to build a diffence (green marked) not a sum.
The blue marked total is wrong by 500 which results through the 2 times summed first row in the group.
btw:
the reason for the problem is not the row per se. Because if i change the sorting in the group, so the green marked group with 500 is not the first row in the group, it is summed correct.
But an other row, which is the first in the group now, f.e. the 1200 row is now summed twice.
So the problem need to be searched in the first row in the group.
But i cant see the problem?!
the custom code with the manual sum creation is:
Public dim summe as Decimal = 0
Public function AddSum(sum as Decimal) as Decimal
summe = summe + sum
return sum
end function
Public function PrintSum()
return summe
end function
---
.. and i do the summing in the green marked field:
=Code.AddSum(
iif(sum(iif(Fields!va.Value = "Angebot", Fields!jb.Value, nothing))=0,
cdbl(0),
Min(iif(Fields!va.Value = "Angebot", Fields!jb.Value, nothing)) - sum(iif(Fields!va.Value = "Vertrag", Fields!jb.Value, nothing))
)
)
and in the blue marked total sum i only have:
=Code.PrintSum()
---
i do the sum calculation of the groupsum not with the normal sum() funktion.
I do it in the Group-field (blue 3596,00 ) with:
=iif(Fields!va.Value = "Angebot",
iif(sum(iif(Fields!va.Value = "Angebot", Fields!jb.Value, nothing))=0,
cdbl(0),
Min(Fields!jb.Value)),
sum(iif(Fields!va.Value = "Vertrag", cdbl(Fields!jb.Value), nothing))
)
----
fyi: I have no filter or visibility settings in group or rows.
THX 4 any helf
Greets Pit
October 19th, 2012 7:12am
Hi again,
is there really no one, who had this problem in double summing of the first entry of a group?
THX, Greets Pit
October 22nd, 2012 5:57am
Hi all,
is my explanation to heavy?
Please. any hint could help.
thx, greets pit
Free Windows Admin Tool Kit Click here and download it now
October 23rd, 2012 5:03am
does really no one have similar things to do?
November 6th, 2012 1:01pm
your best bet is to bring an extra column from your query or stored procedure for that column in green, rather than doing the min in the report. Then, simply sum up this new field. Hope that will give you some idea. good luck.
Free Windows Admin Tool Kit Click here and download it now
November 6th, 2012 1:18pm


