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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding sub and Grand totals for formula field 1

Status
Not open for further replies.

JanCampbell

Instructor
Jun 19, 2003
11
GB
I am new to Crystal and have a very simple problem:

I have a formula field calculating commission based on a 'Total Value' field in the report.

For example, the formula reads: if product_type = "XXX" then (sale_value*5)/100 else (sale_value*2.5)/100

All I want to do is add a sub-total and grand total for my formula field.
Quickest solution for a not-too techie person would be gratefully appreciated.
Thanks
 
From the design window, right click the field and select insert summary. Pick the field you wish to summarize by.

Repeat this only select "insert grand total", to get the grand total.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Yes - that is the way that I tried first of all but when you have a formula field, you don't get the option to insert summary fields in the same way you do for standard numeric fields.
 
Where are you placing this formula? It must be in the detail section for this to be able to be summarized. Please post your formula to this forum.

Also, upon re-reading your original post, you said "total value" field in the report. How is the formula above a total value field?



Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Thanks for your reply.
Here is the formula:
({Reporting_Product_Needs.Total Contract Value to Break}*{@CommRate})/100

where @CommRate is:
if GroupName ({Reporting_Product_Needs.Sale Type})= "New Sale" then 1.25 else 0.5

It is in the Detail section.
Hope this helps.
 
The problem is that {@CommRate} is itself a summary formula by virtue of the groupname reference. Is this necessary? Can you not tell the commission rate from the sale type field ?

Why not have your formula like this:

{Reporting_Product_Needs.Total Contract Value to Break}/100 * if {Reporting_Product_Needs.Sale Type}= "NEW SALE" then 1.25 else .5

If you can do that I see no reason for the second formula of {@CommRate}, and the formula should then be available to be summarized.


Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Thank you for your help.

I did the following:

Amended my formula as suggested:
({Reporting_Product_Needs.Total Contract Value to Break}/100 * if GroupName ({Reporting_Product_Needs.Sale Type})="New Sale" then 1.25 else 0.5 )
That bit worked fine.

However, despite the change, I am still unable to summarise this formula field.
 
You did not read my post very well.

Dump the groupname() from the formula, just test the field value of sale type. Then you can summarize it.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Sorry - I did try dumping the groupname. Same result.
I can get my sub totals in because each group has just one commission rate.

So my sub total formula is:
(Sum ({Reporting_Product_Needs.Total Contract Value to Break}, {Reporting_Product_Needs.Sale Type})*{@CommRate})/100

However for my grand total, I simply want to sum the results of the above - and that is where I have the problem - trying to summarise a summary.
 
I don't usually do this, but please email me this report and I will take a look at it.

You could do this with variables, but this should not be
necessary.

dgilsdorf@trianglepartners.com




Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Foranyone else following this thread, my solution worked. This was a communication problem on how to insert a grand total.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top