Skip to Content
author's profile photo Former Member
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

**PH : Page Header

GH : Group Header

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.

Thanks in advance,

Ryan

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

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

    moved to report design forum

    Add a comment
    10|10000 characters needed characters exceeded

  • 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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.