Symptom
Resolution
The basic formula for calculating a Geometric Mean is Exp(Log(X)/N), where X is the product of the data points and N is the count of the data points. Following the basic structure of the manual running total, a series of three formulas can be used to determine and display the Geometric Mean. The formulas must process in the WhilePrintingRecords phase so the results must be displayed in a footer and not in a header. To display a Geometric Mean perform the following steps:
- Go to Start > Programs > Crystal Reports XI and open the report.
- In the appropriate header insert the formula:
//@Geometric Mean - Initialize
//This formula should go in the header (group, report)
//for the set of data points involved in the calculation
whileprintingrecords;
numbervar product := 1;
numbervar counter := 0;
- In the same section level insert the formula:
//@Geometric Mean - Evaluate
//This formula should go in the same section level (details, group
//footer) of the set of data points involved in the calculation
whileprintingrecords;
numbervar counter := counter + 1;
numbervar product := if {table.numericfield} <> 0 then (product * {table.numericfield};) else product;
- In the appropriate footer insert the formula:
//This formula should go in the footer (group, report)
//for the set of data points involved in the calculation
whileprintingrecords;
numbervar product;
numbervar counter;
Exp(Log(product)/counter);
Keywords
Geometric Mean , 8401675 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To