>Does anyone have a way to compute a average of data in footer bands. Data with value of 0 should not be counted in average.
>
>In other words if data in shown in detail band is 16, 0, 0, 0 the average should be 16 not 4.
If you drive your report with a custom cursor, you could pre-compute the values in the SELECT - SQL or whatever else you're doing.
It's been so long since I used report variables I barely remember how to use them, but maybe you could do something like:
- define a report variable, say SparseCount
- for Value to store put in something like IIF( ColumnValue = 0, 0, 1 )
- initial value should be OK at zero
- reset the value at the appropriate grouping level
- calculation type would be "Sum"
This would give you the denominator.
You would define another simple report variable just to sum the values e.g. SumTotal
In the footer you put in IIF( SparseCount > 0, SumTotal / SparseCount, 0 ) (eliminates errors caused by divide by zero if no non-zero values in your report)
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up