?
Solved

Getting the sum of a formula field in Crystal reports 8.5

Posted on 2006-11-30
5
Medium Priority
?
2,149 Views
Last Modified: 2012-06-27
I'm new to Crystal and have created this formula(@TotalCheckAmount):
IF ({PR1_EmployeeMaster.PayMethod} = "H")
THEN Sum (({PR_22PerpetChkHistoryHeader.TotalEarningsHours}),{PR1_EmployeeMaster.EmployeeNumber})* {PR1_EmployeeMaster.PayRate1}
ELSE SUM (({PR_22PerpetChkHistoryHeader.GrossWagesThisCheck}),{PR1_EmployeeMaster.EmployeeNumber})

The formula works fine but when I try to create a formula that will give me the sum; SUM {@TotalCheckAmount}
I get errors.  Is there a way to get this to work?

Thank you!
0
Comment
Question by:dxthorpe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:badstink
ID: 18049727
Create and add the following formulas to the Details section of your report:

//@Hourly Earnings
if ({PR1_EmployeeMaster.PayMethod} = "H")
then {PR_22PerpetChkHistoryHeader.TotalEarningsHours} * {PR1_EmployeeMaster.PayRate1}
else 0

//@Other Earnings
if ({PR1_EmployeeMaster.PayMethod} <> "H")
then {PR_22PerpetChkHistoryHeader.GrossWagesThisCheck}
else 0

//@Total Earnings
({@Hourly Earnings} + {@Other Earnings})

I'm assuming that you have created a Group on the {PR1_EmployeeMaster.EmployeeNumber} field so simply include a Sum of {@Total Earnings} field in your Group Footer section to see that employees total.  If you want a grand total for all employees, then copy and past the Sum of {@Total Earnings} to the Report Footer section.

You can always suppress the Details section or any formula fields that you don't want visible in your report.

Jeff
0
 
LVL 35

Expert Comment

by:David Todd
ID: 18049730
Hi

Should it be instead
SUM (@TotalCheckAmount)

Regards
  David
0
 

Author Comment

by:dxthorpe
ID: 18049781
I'll give this a try and let you know how it goes.
0
 
LVL 2

Accepted Solution

by:
badstink earned 1500 total points
ID: 18049824
By the way, dxthorpe, the reason that I provided you the solution that I did was so that you would have the luxury of generating totals/subtotals of Hourly Earnings and Other Earnings if you should so desire.  There is a simpler way to do it but I thought you might like the extra possibilities.

Jeff
0
 

Author Comment

by:dxthorpe
ID: 18050014
Thanks this got me going in the right direction.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question