General information
Category:
Reports & Report designer
Scott,
I do a lot of this. One reason is that I need averages of all row-values where the column had an entry, not average of all values including the 0-entry rows. (Average length of hospital stay for a certian diagnosis.) I have averages over the small group, larger group, and grand totals.
Anyways, use report variables. (Reports | Variables)
Variable nSumOfCount, Value to store: Count, Calculate Sum
Variable nSumOfDays, Value to store: NumberOfDays, Calculate Sum
Then in your report,
Report expression: IIF(nSumOfDays > 0, nSumOfCount/nSumOfDays, 0)
Calculations: Nothing
Print When: nSumOfDays > 0, Repeated Values = Yes
This will give you blanks where there were no days, or you can skip the Print When and have zeroes, or change the expression to IIF(..., STR(...), "None")
>Is there a way to put a formula as a subtotal / total in a report column?
>
>
>here it what i want:
>
>
> count number of days average count per day
> 10 2 5
> 8 3 2.6
> 1000 1 1000
>total 1018 6 169.69
>
>notice the total of average count per day is the total of count / total of number of days
>
>thanks
>
>scott
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only