Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Rounding Grouped Values Rounds too high Post Reply Post New Topic
Author Message
Smittles
Newbie
Newbie


Joined: 15 Sep 2010
Online Status: Offline
Posts: 5
Quote Smittles Replybullet Topic: Rounding Grouped Values Rounds too high
     Posted: 15 Sep 2010 at 10:28am
Greetings. I'm new to Crystal Reports, but I've got some SQL experience. I've inherited a reporting system that uses an ODBC connection to aggregate traffic from my web server.

Some background: my report has two groups, one that looks to a parent vendor and one that looks to a sub-vendor. The parent vendor group totals all the traffic that its sub-vendors accumulate.

In the database, the summary is looking at a single grouped value, MBytesSent, associated with a vendor id.

My issue is that I want the parent vendor to round after the sub-vendors are tallied, and what I get right now is a rounding that affects all of the parts of the sum.

For example, in group 2 (sub-vendors) I have 3 clients who have pulled down 1.754 GBs, 0.0055 GBs, and 138.40432 GBs, all taken from a VendorId related to their bandwidth within the reporting dates. I would like their sub-total to work like this:

RoundUp({1.754 + 0.0055 + 138.40432}) = 141 = parent vendor total

instead, I'm getting, effectively, this:

RoundUp({2+1+139) = 142 = parent vendor total

The RoundUp is rounding up all of the smaller amounts before it gives the total, supplying an extra gigabyte to the report, which is incorrect. This get worse (meaning the rift widens between mathematical reality and the report's display) the more contributing sub-vendors I have with an associated parent vendor, essentially by one whole number per sub-vendor.

So, what am I doing wrong? I've tried to keep the unrounded totals in a container function, then pass that container total to a rounding function, but I fear since they're all pulling the data from the same column in the MSSQL database, there's no way around it.

Any help would be greatly appreciated. If I need to explain further, I can try to do that, too, if it helps make more sense of the scenario.

Thanks in advance :)

Edited by Smittles - 15 Sep 2010 at 10:29am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Sep 2010 at 11:43am
if you apply the roundup() at the detial section level it will apply the rounding before summing.
if you apply it to the summed group total you should get what you want ...
Roundup(SUM(gb_field,subvendor))
although I am not sure how you will be able to use this to get a total for all vendors.
 


Edited by DBlank - 15 Sep 2010 at 11:43am
IP IP Logged
Printable version Printable version

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