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

Running Total Formula in the Chart!!

Status
Not open for further replies.

maxi

Programmer
Feb 5, 2001
7
US
Hi,
My report is supposed to display a bar graph for three Values based on three different date fields.

Value a = Current Month;
Value b = Previous Month;
Value c = YTD;

The YTD is calculated as a running total i.e. Sum({c})with the evaluation formula as:

(Year({DateField}) = Year({?ParameterdateField}) and
Month({DateField})> 0 and Month({DateField})< 13)

When I plot a graph for these three fields for a given month it shows the right numbers except for YTD.( I had to use the (MAX)summary function in the DataExpert to display a & b). The chart is placed in a group which is not a {DateField}. The selection expert has the following filter:

({DateField}<=({?ParameterField})
I am using SQL server with Crystal Reports 8.0.
It would be a great help if anybody can tell me how to let the graph display a sum of ({c}) for all the months till that date. Thanks a lot in advance.
 
Don't use a running total, that will make things more complicated. Use three conditional totals.

Create one formula for each condition, for example:

If {date} in LastFullMonth
then {number}
else 0


Now create grand totals for each of these three formulas.

Last create an 'advanced' chart in Crystal and put all three into the &quot;Show Values&quot; box.
Change the &quot;On Change Of&quot; to &quot;For all records&quot;. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top