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

Multi-field Sum by Group

Status
Not open for further replies.

BradCustom

IS-IT--Management
Oct 5, 2007
296
US
Having a problem with a formula that I could use some help solving. Below is my formula that works for the sum of {@Hours}
Code:
if {@DayofWeek}="Saturday" and Sum ({@Hours}, {Attendance.Work_Date})>12.5
then 5
else
(
if {@DayofWeek}in ["Monday","Tuesday","Wednesday","Thursday","Friday"]
and Sum ({@Hours},{Attendance.Work_Date})>17.5
then 8
else
Sum ({@Hours},{Attendance.Work_Date})
)
What I would like to do with this formula is to add {@PTO} and {@Holiday} so that the subtotal adds Worked hours + PTO Hours + Holiday Hours by the Group Attendance.Work_Date
Here is one of the formulas I've tried.

Code:
if {@DayofWeek}="Saturday" and Sum ({@Hours}, {Attendance.Work_Date})>12.5
then 5
else
(
if {@DayofWeek}in ["Monday","Tuesday","Wednesday","Thursday","Friday"]
and Sum ([({@Hours},{Attendance.Work_Date},({@PTO},{Attendance.Work_Date}),({@Holiday},{Attendance.Work_Date})]),({)>17.5
then 8
else
Sum ([({@Hours},{Attendance.Work_Date},({@PTO},{Attendance.Work_Date}),({@Holiday},{Attendance.Work_Date})])
)
When I check this code it says I am missing a ) so obviously it's not right. Any help would be appreciated.
Thanks, Brad
 
I fixed this issue by creating a group level formula to add (Worked hours + PTO Hours + Holiday Hours)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top