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

ReportBasic Derived Field Macros

Status
Not open for further replies.

LifespanWriter

Technical User
Nov 14, 2005
8
US
I had to create ReportBasic derived field macros in ReportSmith to add Derived Field result amounts to summary fields. I have them grouped and summed by pay ending date. Here are 2 examples of the ReportBasic macros I used.

This one added the hours from my “REG” derived field to the Summarized amount of hours from another derived field called, “OTHHRS”:

Sub WRKD()
REGU=VAL(SumField$("REG","Derived Field",1,"Sum"))
OTH=VAL(Field$("OTHHRS"))
TOTAL=REGU + OTH
DERIVEDFIELD STR$(TOTAL)
End Sub

This one added the earnings from my “GROSS” and “OTCODES” derived fields to the Summarized amount of earnings from other derived fields called, “GROSSA” and “GR508”:

Sub GROWAG()
GRO=VAL(Field$("GROSS")
GROA=VAL(SumField$("GROSSA","Derived Field",1,"Sum"))
GR508=VAL(SumField$("GROS508","Derived Field",1,"Sum"))
OT=VAL(Field$("OTCODES")
TOTAL=GRO - GROA - GR508 - OT
DERIVEDFIELD STR$(TOTAL)
End Sub

If it wasn’t for people who have multiple cost center salary splits (5 or more splits), I wouldn’t even have had a problem, but they are the reason why I had to do these. My problem now is that I can’t figure out how to do Sums of these Sum fields. For instance, I now want to show a count of individual’s pay ending dates (whether they are weekly or biweekly, as we have both) within the reported period, but because of both the use of the above ReportBasic macros and that I had to make sure to include hours from each individual cost center, the report counts 55 instead of what I know should be 13. I also need to be able to do a Total Sum of all paycheck earnings and an Average earnings as well, but again I’m running into the problem.

So in a nutshell, my question is, with my current settings and ReportBasic derived fields, how do I do a Count of Pay Ending Dates, a Total Earnings Sum and an Average Earnings?


Richard Sanders
Payroll/HR Systems Specialist
Lifespan Corporate Services
Providence, RI
 
I think you need to loop through them adding the values up. Look at the macro in this power point for a very simple example. The macro is about 3/4 of the way into the ppt.


CharlesCook.com
ADP - PeopleSoft - SAP
ReportSmith - Crystal Reports - SQR - Query - Access
Reporting - Interfaces - Data Mining
 
Did this help?

CharlesCook.com
ADP - PeopleSoft - SAP
ReportSmith - Crystal Reports - SQR - Query - Access
Reporting - Interfaces - Data Mining
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top