Print Page | Close Window

Help! 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=7893
Printed Date: 17 May 2024 at 10:16pm


Topic: Help! Running Total?
Posted By: 4milligans
Subject: Help! Running Total?
Date Posted: 02 Oct 2009 at 11:31am
I need help!  I only have maybe 2 hours a month to work on this report and I'm getting nowhere...fast!
 
I need to report Payroll hours to our Payroll dept.  Everything is set and working great....except - Overtime.  I report every two weeks, but Overtime is calculated on a 40 hour work week.  I need to figure out, how to extract each week individually to find out if the 40 hour requirement for OT has been met.  Right now my report is set up to calculate OT if department hours > 80 --  90% of the time this works fine, because most associates work 80 + hours in a pay period.  However, if someone works 79.99 hours - OT isn't calculated.....Any suggestions??  Anyone??



Replies:
Posted By: lockwelle
Date Posted: 05 Oct 2009 at 7:10am
I'm for using shared variables, DBlank is for running totals.  From watching, the ideas are similar.  Since you are calculating for an individual, you would want a reset in there, but it would most likely be at where a 'week' is defined to start.  Regardless, the concept is the same, you know the data and the report...
 
in a group header usually, a reset
shared numbervar OT := 0;
""//hides the zero on the report
 
in a group footer, a display
shared numbervar OT
 
usually in the details, the incrementor
shared numbervar OT;
 
if hoursWorked > 40 then OT := OT + (hoursWorked - 40);
"" //hide the calculation (or remove to display/debug)
 
 
the tough part in the line above is how to define hoursWorked.
 
HTH



Print Page | Close Window