Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Calculating Average two different ways Post Reply Post New Topic
Author Message
dadaz
Newbie
Newbie


Joined: 29 Oct 2010
Online Status: Offline
Posts: 4
Quote dadaz Replybullet Topic: Calculating Average two different ways
     Posted: 09 Dec 2010 at 3:30am
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

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Dec 2010 at 4:11am

To display in the header you have to be able to use an insert summary function or a subreport.

Maybe you can use a formula to create a Cross tab 'group' on recorsd that you wan to count vs. not count and use the CT in the header and conditionally suppress the CT row for the ones you want to not count.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum