Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Averaging averages, disregarding Zero Values
Message
From
06/12/2000 18:17:07
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00450159
Message ID:
00450168
Views:
25
Hi John,

Are the Zero lines to appear on the report even though you don't want to calculate on them? If so, then you could define 2 report variables, 1 which counts the number of lines where AVGDAYS # 0 ( Call the Variable something like rvNonZeroLines and in the 'Value to store:' field of the Variable put something like IIF(avgdays # 0,1,0) and set the CALCULATE option to SUM ) and 1 which SUMs AVGDAYS ( Call the Variable rvAvgDays and in the 'Value to store:' field of the Variable put AVGDAYS and set the CALCULATE option to SUM ). At the end of your report ( or in each control break if you're using any ) you can then have a field which is something like:

ROUND(rvAvgDays / rvNonZeroLines,10,2)

This field will ( hopefully <g> ) print the number of AVGDAYS for lines that aren't zero.

Hope this helps,
Gavin...

>In a report I'm working on, I need to calculate a summary of the average days to close. Some detail lines have a Zero AVGDAYS, and I don't want those included in my overall average... How to do this?
>
>Grace and peace,
>John
Previous
Reply
Map
View

Click here to load this message in the networking platform