Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to summarize a summary field

Status
Not open for further replies.

Yumster

Programmer
Apr 3, 2002
12
US
Since Crystal doesn't allow me to summarize a summary field how would I get a report summary.

I have a detail line for a CASE with a newvalue field and an originalvalue field. I have 2 formulas that for each value.
@NEW:
if newvalue then
1
else
0

@ORIG:
if originalvalue then
1
else
0

I then have summarized these by the CASE since there can be several detail lines for each case. I have another formula:
SUM_VAL:
if sum(@NEW,case) >= sum(@ORIG,case) then
sum(@NEW,case)
else
sum(@ORIG,case)

I now want to summarize the @SUM_VAL at report level but of course Crystal does not allow this. Does anyone have a suggestion for a alternate. I could write a stored procedure but I'd like to see if I can do it through Crystal first.

Thanks for any help
 
Right click on your formual field in the details section and select "insert gradn total". Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
The formula (@SUM_VAL) I want to summarize at report level is not in the detail, it is in the CASE group. Summarizing the @NEW or the @ORIG gives the incorrect number.
 
Create three formulas:

1) Reset
whileprintingrecords;
numbervar total := 0

place this in the report header. You can supress printing using the format dialog box.

2) Accum
whileprintingrecords;
numbervar total := total + @sum_val

Place this in the group footer for CASE.

3) display
whileprintingrecords;
numbervar total ;
total

place this in the report footer.

You could have also created a running total that had the same logic. Make sure you accumulate once per group.

Howard Hammerman,

Crystal Reports training, consulting, books, training material, software, and support. Scheduled training in 8 cities.
howard@hammerman.com
800-783-2269
 
Thanks a lot Howard. This worked great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top