Solved

Creat running total refering to a formula with previous function

Posted on 2009-02-13
617 Views
hi,
i'm trying to create a running total field count in my repoort.
i have created a formula that compares an amount field with its previus record amount and
the count needs to meet the condition.

however print time formulas cannot be used.

how can i bypass this?

thanks,
0
Question by:carlosmonte

LVL 77

Accepted Solution

You'll have to build the total in a normal formula field. Example below

whileprintingrecords;
numbervar x;
if {table.field} =previous({table.field} then x:=x+{somevalue};
""

When you want to print the total of x you create another formula field to do that:
whileprintingrecords;
numbervar x;
X
0

LVL 1

Author Comment

and how do i reset count after every change of group#1?
0

LVL 77

Expert Comment

If the running total is for the group then you need a further formula field i the group header:

whileprintingrecords;
numbervar x:0;
""
0

LVL 34

Assisted Solution

A small correction:

The second line in that last formula should be:

numbervar x:=0;

James
0

LVL 34

Expert Comment

I'd give all of the points to Peter.  My post was just a very simple correction, which Peter would have made himself if necessary.  It certainly doesn't deserve half of the points, and I don't really need any for such a small thing.

James
0

Featured Post

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…