Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Formulas in totals
Message
De
08/04/1999 22:03:52
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00206687
Message ID:
00206738
Vues:
27
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform