Print Page | Close Window

Best way to sum up results

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=10325
Printed Date: 02 May 2024 at 9:06pm


Topic: Best way to sum up results
Posted By: Tod Troy
Subject: Best way to sum up results
Date Posted: 22 Jun 2010 at 6:42am
New Crystal Reports 2008 user here and I have a question about summing up results in a report. I'm not sure if I'm going about this the right way, so any advice is appreciated.

In my report there are about a dozen conditions that a client might have. I'm using variations of this formula (@condition) to show when they do (this result appears on the report):

if{label}="condition"
and{result}="Yes"
then"Y"

I have variations of this formula (@conditioncount) going on to try to give a number to the results:

if{@condition}="Y"
then ToNumber(1)

Then in the page footer I'm using a running total field that summarizes the @conditioncount using a sum.

The problem I'm running into is that when the report pulls, say, 5 clients with two same results the running total field tells me the total is 66 for this result. I noticed at the bottom of the screen that "Records" is indicating that there's way more records than are actually displaying, but I'm not suppressing any results so I don't know why this number would be higher.

Any ideas?



Replies:
Posted By: DBlank
Date Posted: 22 Jun 2010 at 7:03am
suppressing does not impact the sum or count.
make a Running Total
Name=condition1
Field to summarize=Client ID field
Type of Summary=DistinctCount
Evaluate=Use a Formula
{label}="condition" and {result}="Yes"
Reset=Never
Place in the report footer.
Reeapt fro each ciondition you want to count


Posted By: Tod Troy
Date Posted: 22 Jun 2010 at 7:32am
Excellent- works like a charm! Thanks so much!



Print Page | Close Window