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

Payroll- how to add week 1 and week 2 per employee?

Status
Not open for further replies.

RoxSki

Technical User
Dec 20, 2012
6
0
0
I am attempting to convert our company's payroll to Crystal version 11.5.12.1838. I am not a pro at Crystal but I do know more than just basic reporting. I have to use a formula for pay hours (not just the pay hours field). I can't seem to get the
Reg Hours: (if Sum ({laborhed.payhours}, {laborhed.clockindate}, "weekly")>40 then 40 else Sum ({laborhed.payhours}, {laborhed.clockindate}, "weekly"))
and the
Overtime Hours: if Sum ({laborhed.payhours}, {laborhed.clockindate}, "weekly")>40 then Sum ({laborhed.payhours}, {laborhed.clockindate}, "weekly")-40 else 0
to add together! I have read posts and forums.....
How to I get the 2 weekly totals to add together for a grand payperiod total for Reg and OT?
please help.
 
Unless I am missing something, another formula with the following (assuming names for the formulas) {@Reg Hours}+{@Overtime Hours}

I hope this helps.
 
I wish it was that easy. When I try to summarize week1 Reg Hours with week2 Reg Hours, I get the message fields can not be summarized!
 
It seems to me like something is missing, but ...
what happens if you use variables?

{@HoursCalc}
numbervar r40;
numbervar o40;
(if Sum ({laborhed.payhours}, {laborhed.clockindate}, "weekly")>40 then r40 := 40 else r40 := Sum ({laborhed.payhours}, {laborhed.clockindate}, "weekly"));
(if Sum ({laborhed.payhours}, {laborhed.clockindate}, "weekly")>40 then o40 := (Sum({laborhed.payhours}, {laborhed.clockindate}, "weekly")-40) else o40 := 0);
r40 + l40



 
EDIT: I have the variable wrong is the last line. l40 should be o40.

{@HoursCalc}
numbervar r40;
numbervar o40;
(if Sum ({laborhed.payhours}, {laborhed.clockindate}, "weekly")>40 then r40 := 40 else r40 := Sum ({laborhed.payhours}, {laborhed.clockindate}, "weekly"));
(if Sum ({laborhed.payhours}, {laborhed.clockindate}, "weekly")>40 then o40 := (Sum({laborhed.payhours}, {laborhed.clockindate}, "weekly")-40) else o40 := 0);
r40 + o40
 
thank you, I have not used variables yet. I will try it.
Do I put this in the employee group or the week group?
 
this doesn't work either.
 
You can use variables to collect each of the Reg and OT hours across employees. But you need to tell us your report structure. Please identify all groups by the field you are grouping on and explain at what group level(s) you want to see the totals for REG and OT.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top