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

Charting the output of a formula

Status
Not open for further replies.

wreiche

IS-IT--Management
Sep 28, 2006
36
CA
I have a data set which has summarised events on a monthly basis:

Region Month Nbr_Evnts Evnt_Time

I would like to generate a chart of this data summarised year to date. I cannot use a simple average on evnt_time because the average time must be scaled proportionately to the number of events which make up that average. I can do this using a formula, but how do I get the formula into a chart. Under the data tab, I am only allowed to select data fields and summary fields.

 
The formulas should show up in the data tab with the other fields.

Thanks so much!
satinsilhouette
 
Most but not all formulas can be used in charts. Post the actual formula and we will tell you why it isn't showing up.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides for Formulas, Parameters, Subreports, VB, .NET, Tips and Tricks
 
The formula doesn't appear in the data tab.

The formula is:

WhilePrintingRecords
Global AccCnt as Number
Global AccTm as number
Global LastId as string

if {Sheet2_Print_Area.Region} <> LastId then
AccCnt = 0
AccTm = 0
LastId = {Sheet2_Print_Area.Region}
end if

AccCnt = AccCnt + {Sheet1_Print_Area.Total_Anomalies}
AccTm = AccTm + {Sheet1_Print_Area.Report_Issue_Time_Mean} * {Sheet1_Print_Area.Total_Anomalies}
if ( AccCnt = 0 ) then
Formula = 0
else
Formula = AccTm / AccCnt
end if
 
Anything WhilePrintingRecords is going to happen after the report has done the charting.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides for Formulas, Parameters, Subreports, VB, .NET, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top