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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum of field in Group Footer 2

Status
Not open for further replies.

PeggyC

Programmer
Apr 4, 2002
15
US
Just out of curiosity, is it possible to make a formula to sum what's in a Group Footer. What I mean is if I have only 1 field in a group footer that is a count of other fields.. can I do something like sum({GroupFooter2}), using "GroupFooter2" as the field, to get a sum of that count?
 
Why not just sum the database field? Rt click on the field you have already counted in the group footer, insert summary, make it a SUM operation instead of a COUNT, and you are done.

Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
My Count is actually a Distinct Count. I want to sum that Distinct Count. But when I try to create a new formula to sum that Distinct Count, I get an error.

I must be doing something wrong. Any suggestions instructor?
 
This is what I have as Output right now.

Order_no Od_no Qtr_no Description

3 1 1 Pepperoni
Sausage

1

7 1 1 Pepperoni

1

2 1 Sausage
2 Mushroom

1


I have 2 Orders. The first Order contains 1 food item (a pizza) that contains Pepperoni and Sausage (on the whole pizza).

The second Order contains 2 food items (both pizzas). The first pizza contains Pepperoni. The second pizza contains Sausage on one half, and then Mushroom on the other half (as denoted by the quarter number.)

The numbers in bold are my distinct counts on Od_no. (I want to keep track of how many pizzas were ordered.) It's set so that whenever there is a change in the Order_no Group, and then in the Od_no Group, the a distinct count shows.

Now I want to do a sum on that distinct count. But I get an error back everytime I try. The sum should be 3 but I can't figure out how to get it.

Thank you for your help.
 
How about cutting and pasting the error and the formula? Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Distinct Count covers the entire range so wanting to sum the summary is a reasonable request.

You need to use a variable in three formulas..
Reset Total: Place in Report header and suppress
WhilePrintingRecords;
Numbervar c:=0

Calc Total: place in Group Footer
WhilePrintingRecords;
Numbervar c:= c+ DistinctCount({table.field},{table.grp})

Show Total: Place in Report Footer
WhilePrintingRecords;
Numbervar c

Editor and Publisher of Crystal Clear
 
Thank you both, chelseatech and dgillz, for your help. The formulas worked great.

dgillz, in case you're still curious, when I tried to sum my distinct count this was the error that kept coming up
"the summary/running total field could not be created"

Have a wonderful day...
Peggy
 
I also had a problem about a similar situation. I was quite lost and your answer worked fine. I give you a star. Hope it helps

SC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top