Solved

Getting the sum of a formula field in Crystal reports 8.5

Posted on 2006-11-30
5
1,977 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
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:badstink
Comment Utility
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
Comment Utility
Hi

Should it be instead
SUM (@TotalCheckAmount)

Regards
  David
0
 

Author Comment

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

Accepted Solution

by:
badstink earned 500 total points
Comment Utility
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
Comment Utility
Thanks this got me going in the right direction.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now