Former Member

# Calculation Formula Question in Crystal Report

Hi all, my name is Ryan

I Have a question for my crystal report. I have this report

PH EMPLOYEE NAME SALES POINTS

GH SALES MARKETING EMPLOYEES

DETAIL JARED 100

MIA 250

AARON 50

MICK 200

SARAH 25

GAIL 150

GF 775

GF : Group Footer

I want to do calculation between (SALES POINTS details) /(Total in GF) but my total in GF is a formula based on three formula:

1st formula in the Report header(Suppressed) :

numberVar TotalSlsPoints;

whileprintingrecords;

TotalSlsPoints:=0;

2nd Formula in the Detail(Suppressed) :

numberVar TotalSlsPoints;

whileprintingrecords;

TotalSlsPoints:=TotalSlsPoints+{@Balance_Feb};

3rd Formula in the Group Footer (Not Suppressed and it is displayed in the GF like the explanation above):

numberVar TotalSlsPoints;

whileprintingrecords;

TotalSlsPoints;

So the report would be like this :

PH EMPLOYEE NAME SALES POINTS AVG

GH SALES MARKETING EMPLOYEES

DETAIL JARED 100 (100/775)

MIA 250 (250/775)

AARON 50 (50/775)

MICK 200 (200/775)

SARAH 25 (25/775)

GAIL 150 (150/775)

GF 775

Btw I use crystal report 2008. If you guys have the answer please reply coz' I already tried 100 ways to do the calculation but didn't find the right ones.

Ryan

10|10000 characters needed characters exceeded

### Related questions

• Posted on May 07, 2012 at 01:49 PM

moved to report design forum

10|10000 characters needed characters exceeded
• If you can simply sum {@Balance_Feb} per Group Level 1, you have an easy solution: use a sum instead of accumulating into a variable.

• Posted on May 07, 2012 at 03:32 PM

Hi Ryan,

Like Ido said, you do not need all those formulas.

Go to Insert summary > Choose the 'Sales Points' field as the field to summarize and choose the location as 'Group Footer'.

This will give you the sum of sales points for every group.

To calculate the average for each detail line create this formula and place it on the detail section:

{Sales Points}/Sum({Sales Points}, {SALES MARKETING EMPLOYEES})

Replace {Sales Points} with the name of the field and {SALES MARKETING EMPLOYEES} with the name of the field that the report is grouped on.

Hope this helps!

-Abhilash

10|10000 characters needed characters exceeded
• Don Williams Former Member

Hi Ryan,

The problem is the total or summary must be totalled before the details section. Couple of ways I can see, likel ymore ways also, create a subreport to get the total for each group or use a SQL Expression based on your group and "sum(DBField) where group = "thegroup" ( or something like that ). Don't know your data source, try running the SQL on the Server to see what syntax is required first for a SQL Expression.

Then you insert a text object and drop the first field into it and then drop your new Summary field after a "/" is typed in.

Hope that helps

Don