Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Averages and Rounding Post Reply Post New Topic
Author Message
ChrisKenny
Newbie
Newbie
Avatar

Joined: 08 Dec 2010
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote ChrisKenny Replybullet Topic: Averages and Rounding
    Posted: 08 Dec 2010 at 10:30pm

Hi,

I hope someone on here can help me, I've been trying to find out how to do this for ages but to no avail!

I have a cross-tab table as follows

{Person}{AuditSurvey.SvName1}|{AuditSurveyAnswer.SvScore}|{Avg of AuditSurveyAnswer.Score (Number)}
 
And so on.  At the end of the report I need to count all the rows which have an average of >=4.  This is done via a running total, summarising {Job} and using a distinct count and evaluating using the formula
 
Average ({AuditSurveyAnswer.SvScore}, {AuditSurvey.SvName1})>=4
 
The problem seems to be that it is rounding up.  The {Avg of AuditSurveyAnswer.Score (Number)} scores are formatted to 2dp of the 15, all are >= 4 with two exceptions, which are 2.88 and 3.88.  The formula I have gives me a count of 14 as being >= 4, I think this is caused by CR rounding up, as when I change the data to be <3.5 it appears to count it correctly.
 
 I am using CR 2008. 

Many thanks.
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 09 Dec 2010 at 3:29am
I'm curious, if you had it display the average, what would the one for 3.88 say?
IP IP Logged
ChrisKenny
Newbie
Newbie
Avatar

Joined: 08 Dec 2010
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote ChrisKenny Replybullet Posted: 09 Dec 2010 at 3:51am

Hi Keikoku

Please see these images, hopefully it will make it a bit clearer.  Its the number at the bottom of the second picture - notice how it says only 14 are >= 4, whereas its actually 13, so its not counting the 3.88 value.
 
 
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 09 Dec 2010 at 5:26am
You're right, it should be 13..
If you set your condition to be < 3.9, would it return one or two? We would expect two, but if it really is a rounding problem then we would only get one.

I don't actually know what the problem might be so I'm just wondering if it really is a rounding problem cause that'd be pretty bad for me as well since precision is important :(

Edited by Keikoku - 09 Dec 2010 at 5:27am
IP IP Logged
ChrisKenny
Newbie
Newbie
Avatar

Joined: 08 Dec 2010
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote ChrisKenny Replybullet Posted: 09 Dec 2010 at 5:40am

Changing it to <3.9 gave me a total of 20, which caused me to look at the running total.  Turns out my running total was including those which did not have a score marked against it, hence why it was going werid..  Thanks for the help!

IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 09 Dec 2010 at 5:45am
So did that solve the initial problem?

It's interesting because when you specified < 3.5, it was correct, but when you specified < 3.9, it was wrong.

And all that shouldn't have anything to do with the values >= 4

Now I can't imagine why that might be the case...



Edited by Keikoku - 09 Dec 2010 at 5:45am
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.