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

How Do I Calculate % of a DateDiff Sum 1

Status
Not open for further replies.

Sange

Technical User
Jun 10, 2002
85
AU
Hi, I am using CRv10 with an Oracle database.

I have a report which currently calculates the total amount of work hours expected compared with hours actually worked for each agency.

To do this, I created formulas to calculate the datediff (in seconds) for Scheduled and Actual hours and then summed the formulas at the group level (agency name).

I then created two additional formulas at the agency name level. One to display the sum of scheduled hours to be worked in (hh:mm) and the second to also display the sum of actual hours worked in (hh:mm).

The report currently looks something like this:
Agency Name Scheduled Hours Actual Hours
Agency 1 25.30 20.15
Agency 2 35.45 15.46

The customer would now like to see a % of the hours worked for each agency and I have just realised that it won't be a simple case of dividing "actual hours" by "scheduled hours" * 100!

I'm hoping someone can assist me with this calculation. Any suggestions would be most appreciated.

Thank you in advance.
Sandra
 
You just need to use your formulas in seconds form for the percentage and ignore the ones you converted into strings:

sum({@workedseconds},{table.agencyname}) % sum({@scheduledseconds},{table.agencyname})

-LB
 
Hi lbass, as always you have been very helpful.

Your solution is so logical that I'm actually quite embarrassed I didn't see it myself!

Also, I have never used your way of calculating % so will definitely do so from now on - thanks for including it in your post.

Sange
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top