Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Blank fields change average values
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00435828
Message ID:
00436270
Views:
26
Thanks for all the help

I'll try the "long way" to see how it goes - BTW does anyone know if this is problem which has been fixed in the new version of VFP?

Wishfull thinking on my part no doubt!

Regards

Chris

>>Hi all
>>
>>I've noticed that when generating reports, VFP takes a blank field as a zero - which effects the average of the values at the end of a report I'm generating. Does anyone know a simple way to get around this - I've been exporting the tables to Excel, which simply ignores the blank fields (for the purposes of averaging)...but I'm quickly getting sick of doig it this way.
>>
>>Thanks in advance...
>>
>>
>>Chris Kable
>>FuelTrac
>
>Don't use Foxpro's native average calculation. Instead, use report variables to calculate your own average. Have one variable, nSum, that has an expression of IIF( <> 0, , 0) and has "SUM" marked as the calculation. Then create another variable, nCount, that has an expresion of IIF( <> 0, 1, 0) and mark "SUM" as the calculation. When you are ready to print the average, create an expression that is "nSum / nCount".
>
>It's more work on your part, but it will work.
>
>Cathy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform