Print Page | Close Window

Running Total

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=11515
Printed Date: 03 May 2024 at 1:01pm


Topic: Running Total
Posted By: 4milligans
Subject: Running Total
Date Posted: 25 Oct 2010 at 8:40am
I've looked for guidence here before, but couldn't get my running total to work.
 
Problem:  I need to be able to capture 2 weeks worth of pay roll data, but only calculate over time 1 week at a time.  Right now, I run 2 separate reports.  One calculating the first week of the pay period and the second for the second week.  I export these two reports into Excel, sort them by associate and then subtotal the hours.  We pay overtime if an associate works more than 40 hours per week, I know there's a way...just can't figure it out!  HELP :)



Replies:
Posted By: DBlank
Date Posted: 25 Oct 2010 at 9:30am

what is your raw row level data like?



Posted By: 4milligans
Date Posted: 27 Oct 2010 at 9:18am
I have the data in Group Header 2 (by name) and it holds the following:
 
BU (business unit)
PR ID (pay roll ID)
Full Name
@REG HRS
@OT HRS
@VAC HRS
 
 
REG HRS Formula:
if ( mailto:%7b@OT - {@OT HRS}>0.00) then
(sum ( mailto:%7b@NON - {@NON PTO HOURS},{PUNCH.EMPLOYEE ID}) - mailto:%7b@OT - {@OT HRS})
else (sum ( mailto:%7b@NON - {@NON PTO HOURS},{PUNCH.EMPLOYEE ID}))
 
OT HRS Formula:
if sum({PUNCH.DEPT HOURS},{PUNCH.EMPLOYEE ID})> 40.00
then sum({PUNCH.DEPT HOURS},{PUNCH.EMPLOYEE ID}) - 40.00
else 0
 
VAC HRS Formula:
IF {PUNCH.NONWORKED} = "Vac"
THEN
{PUNCH.DEPT HOURS}
else 0.00
 
I realize the way the OT formula is written that it's only going to calculate OT based on a 40 hour week.  I would really like to rewrite that based on the running total of hours per week - make sense?



Print Page | Close Window