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

Running Total of Formula field having Previous

Status
Not open for further replies.

Kanu01

MIS
Aug 16, 2012
2
GB
Hi folks,

This is my first question in this prestigious forum of Crystal Reports experts & users.
I am trying to create a running total of a formula field, which also contains 'Previous' function. The problem is that in the running total tool I can not see this field. How can solve this problem?

The formula in the field is: {Command.Total Sales}-Previous({Command.Total Sales})

Thank you in advance.
Best Regards,
Kanu
 
You will have to use a variable to capture data and effectively make your own Running Total.

@Eval// place this in details
Whileprintingrecords;

global numbervar total;

total:= total + {Command.Total Sales}-Previous({Command.Total Sales});


@display// place in report footer
Whileprintingrecords;

global numbervar total;

Ian

 
Hi Ian,

Thanks for the solution. It works; but how can I reset the report at the month end like I can do for the running field.


Thanks.
Best Regards,
Kanu
 
Assuming you are grouping by month

@reset// place this in month group header
Whileprintingrecords;

global numbervar total:=0;


Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top