# average on crystal report with 3 groupings

Hi,

I have a Crystal Report with 2 groupings I want to to calculate the percentage.  I having difficulty with setting up the running total with avg.

The field is a formula.

So here is the organization of the report:

Operational
acct-type Revenue
deptid
acct-type Expense
deptid
acct-type Captial
deptid
Projects

acct-type Revenu
deptid
acct-type Expense
depid
acct -type Capital
deptid

I would like the avg formula to calculate on the deptid
avg formula is :  actuals/ytd amt
How do I set up the running total wizard?

Thanks,
Lucy

using crystal 9.0

###### Who is Participating?

Commented:
Average in both summary and running total is an average of a single field.

I believe that what you want is a formula which reads.

if(sum({ytd amt},{deptid) <> 0)then
sum({actuals},{deptid})/sum({ytd amt},{deptid})
0

Commented:
Can you use the summary functions rather than a running total?
Right click the field
Click INSERT --> SUMMARY

You can set the running totals up to reset on change of a group

mlmcc
0

Author Commented:
So,

Sum ({NC_BUDGET_SUM_LNS.NC_YTD_BUDG_YR_CUR}, {NC_BUDGET_SUM_LNS.DEPTID})<>0 THEN

Sum ({NC_BUDGET_SUM_LNS.NC_ACTL_DEC_BUDG}, {NC_BUDGET_SUM_LNS.DEPTID})/Sum ({NC_BUDGET_SUM_LNS.NC_YTD_BUDG_YR_CUR}, {NC_BUDGET_SUM_LNS.DEPTID})

But it is not caculating properly on the group dept:

example:

409,017/554,286   is not equal to 1.

I put the formula at the deptid footer.

Thank you,
Lucy

0

Author Commented:
ok I multiplied by 100 and now it is happy.  Please don't close yet I need to do it on the next grouping.

I am loosing my mind :-)
0

Author Commented:
Thank you all for assisting.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.