Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Formulas in totals
Message
From
08/04/1999 22:03:52
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00206687
Message ID:
00206738
Views:
26
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
Map
View

Click here to load this message in the networking platform