At 11:36 AM 8/15/2004 -0500, Bill Niehaus wrote:

I would like to display a report with a value from a table along with an
average for a group of values from the same table.  Then I would like to
subtract the average from the current value.   I'm not sure how to get
an average calculated and into a report.


Bill,

You'll need to use "DB Calc" control to achieve your goal.

Here's how:

01. While in Report Designer, select "DB Calc" control, part
    of Database Control, and place it on the desired report band.

02. From the Data Field ComboBox, select appropriate column name.

03. Right-click on the DB Control object and select Calculations...

04. Select "Average" from the list of Calc Type.

05. Select appropriate "Break" to Reset values, if necessary.

06. Click on [OK]

07. Use "Report Preview" option to preview the report.

That's all there is to it!

DB Calc control is used to perform common report calculations
and print the resulting value. The calculation is performed
based on the value of the column specified in Data Field. Use
the DB Calc property to indicate the necessary calculation.

Calculations such as break totals are available through Reset
Group property. Each time the column value for the Reset Group
changes (breaks), all associated DB Calc controls are reset to
zero.

DB Calc control includes the following calculation types:

Count:
Count one for each group of records where the Reset Group field
value is the same

Sum:
Sum data values for each group of records where the Reset Group
field value is the same

Minimum:
Minimum data value for each group of records where the Reset
Group field value is the same

Maximum:
Maximum data value for each group of records where the Reset
Group field value is the same

Average:
Average of all data values for each group of records where the
Reset Group field value is the same

For more details:

From The Edge: http://www.razzak.com/fte
(Powered by R:WEB Suite)

Search Articles | Topic Header | DBCalc > Search ...

Have fun!

Very Best R:egards,

Razzak.



Reply via email to