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

Summarizing dynamically in groups

Status
Not open for further replies.

gmal1

IS-IT--Management
Mar 4, 2008
6
0
0
US
I have a formula: Sum({Charges}, {Division}) that works great in the group called "Division". But I have several other groups which will also require a summary like that. I need to use the result of that formula in several other formulas, so I cannot use the "Insert, Summary" functionality.
Is there a dynamic way to refer to the current Group the formula is in, so it will summarize within that group without using the groupname? My other possible solution is to use subreports for each group, but that seems tedious, and hard to maintain.
thanks
Gmal
 
Ok, understanding your dilema, and not seeing a way to use dynamic population of the group by field in the sum() formula, I suggest to create 1 formula per group which does the summing.

However, stored the result of these sums in a variable and use the variable in the other formula that require the result.
 
You can do a running total that adds just for one value, which could be "Division". Set to work for the whole report, it would be available to groups after "Division". It won't be right until after the line has printed. (If you're not already familiar with Crystal's automated totals, see FAQ767-6524.)

Or you can do it with a variable, as beltmanjr suggests. Add if the condition applies and otherwise not. You'd need one total per condition but this could apply for the whole report using a summary total.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
You need to make a separate formula per group.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top