Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report Variable Average Exclude some values
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01237593
Message ID:
01237596
Views:
19
>I have a report variable rm_Avg_Turn. The calculate option is set to average, and the Value to store is TurnMinutes. This all works great. The twist is that I want to print all records, but exclude from the average where the turnMinutes is greater than 60. I think in Value to store I could do an iif(turnminutes>60,0,TurnMinutes) but I also think that would ruin the average throwing a zero in.
>
>Any ideas?
>
>Thanks
>
>Kirk

How about two variables?
one (i.e. SumMins) -> calculation SUM->Value to store iif(turnminutes>60,0,TurnMinutes)
other (i.e. CntMins) -> calculation SUM->Value to store iif(turnminutes>60,0,1)
Then just divide SumMins/CntMins
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform