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

Group Header Percentage Calculation

Status
Not open for further replies.

zebcrystal

Technical User
Dec 7, 2009
4
US
I have a payroll report grouped by crew supervisor. I am trying to calculate the percentage of overtime for each crew in the group header. My formula is
{@OT} % {@Total Hrly Hrs}. The result is the calculation of the first employee in the crew.
 
sum({@OT},{groupfield}) % sum({@Total Hrly Hrs},{groupfield})

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Thank you. I inserted the formula into the group header and receive 1.10% for every crew.
 
You need to show the content of your formulas and of any nested formulas. You should also explain your group structure and in which group you are trying to show the percentage.

-LB
 
if{PRPH.Hours}>40 and {PRPH.PRGroup}= 10 then {PRPH.Hours}-40 else 0/
if{PRPH.Hours}>40 and {PRPH.PRGroup}= 10 then {PRPH.Hours}-40 else 0+if{PRPH.PRGroup}=10 then {PRPH.Hours}-
(if{PRPH.Hours}>40 and {PRPH.PRGroup}= 10 then {PRPH.Hours}-40 else 0) else 0

My group structure is by supervisor(crew). The detail of this group would be individual employees. The result of the group is 20 supervisors(crews). I am trying to get the total percentage of overtime for each supervisor's group of employees.
 
I'm not sure what you want for the ratio. If you are trying to compare OT to total regular hours, then you shouldn't add the OT back into the denominator. Right now you are both adding and subtracting OT in the denominator. Be sure to use parens, and try creating the following formulas:

//{@OT}:
if{PRPH.Hours}>40 and
{PRPH.PRGroup}= 10 then
{PRPH.Hours}-40

//{@Reg}:
if{PRPH.Hours}>40 and
{PRPH.PRGroup}= 10 then
40

sum({@OT},{table.crew})%sum({@Reg},{table.crew})

What is PRGroup? If t is the crew group, then yes, you will always get the same answer, since you are referencing only one instance of the group.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top