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!

Running Total - Evaluate on Change of Group PLUS formula? 3

Status
Not open for further replies.

Yerdon

Programmer
Jul 29, 2002
62
0
0
US
Hi,

I set up a running total to summarize a field. It should be evaluated on change of the group. But not always, only if a certain criteria is met.

It seems that I can EITHER use a formula as to when I want to evaluate, OR evaluate when the group changes.

Is there any way to use a formula to also see if the group changed in addition to my other criteria?

Thank you in advance!

JD
 
Use variables:

In the group footer:

WhilePrintingRecords;
If <<Condition>> then Numbervar MyVar:=MyVar+sum({Myfield},{Mygroup})

Then to display the total:

WhilePrintingRecords;
Numbervar MyVar;



Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
An alternative is to create a formula field that does the test, e.g.
Code:
if {code} = "A" then {value} else 0
For Crystal 10, at least, any formula field based on a single set of details can be summed.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
In the running total, choose "evaluate using a formula" and then set it up like this:

(
onfirstrecord or
{table.grpfield} <> previous({table.grpfield})
) and
{table.field} = "X"

-LB
 
Thank you! The suggestions from lbass were what I was looking for, but it turned out that I couldn't use the evaluations I wanted to in the formula, so I had to use what dgillz put down!

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top