Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Averages

Status
Not open for further replies.

dadazs

Technical User
Oct 29, 2010
37
GB
Hi,

I need some help on calculating averages of managers and their clients.

1st calculation is simple - average of all records

2nd calculation - I want to calculate average on values that are above zero.

I cannot find out how can i do it.

The only way i could see the result is this:

sum of not nulls formula:

WhilePrintingRecords
shared x as number
shared man1 as string
shared man as string

man=GroupName ({'____SITE_BUDGETS_____'.manager})

if man <> man1 then
x=0
end if

if {'____SITE_BUDGETS_____'.compliant}=0 then
else
x = x+1
formula = x
end if
man1=GroupName ({'____SITE_BUDGETS_____'.manager})



kind of running total average:

if {@not nulls} >0 then
Sum ({@percent}, {'____SITE_BUDGETS_____'.manager}) / {@not nulls}


The problem with this result is that i cannot move it to the top header.

please help

 
Create a formula {@null} by opening and closing a new formula without entering anything. Then create a formula {@nonzero}:

if {table.value} <> 0 then
{table.value} else
tonumber({@null})

Then right click on {@nonzero}->insert summary->average on {@nonzero} at the group level.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top