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

RunningTotal Calculating Wrong When Group Covers More Than 1 Page

Status
Not open for further replies.

lesleycampbell

Technical User
Jun 21, 2013
59
US
I am using CR11. I have a Running Total in a Group Footer. It calculates correctly until the Group carries over more than one page.

The group to calculate on is CUSTOMER.
Within that group there are then the BILLINGPROFILE, TIMECARD, & PAYBILLCODE groups under that.

I am trying to SUM the hours paid for the Customer when the PAYBILLCODE = "HOUR".

My Running Total sums on the field TimeCard.PayUnits.
It evaluates using this formula --> {TimeCard.PayCode} = "HOUR"
It resets on the group CUSTOMER.

Help?
 
Hi,

So what is the specific value in this instance and what value do you expect?

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
More than likely a bigger significance - I just noticed that it calculates correctly when there are only "HOUR" pay codes. When there are overtime "OVER" hours, it calculates incorrectly.

The first group in question has an employee paid 40 hours at the "HOUR" code and 3 hours at the "OVER" pay code.
Instead of resulting in 40 total hours at the "HOUR" code, it results in "80" hours.
 
To help troubleshoot this, put your running total on the details band and watch the running total accumulate. You should be able to see where it gets off, and that might help you see why.

Also, I usually don't use running totals for simple conditions like this. Instead I would write a formula field called Hour Units:

If {TimeCard.PayCode} = "HOUR"
then {TimeCard.PayUnits}
else 0

Then I would do a summary of that formula using a regular summary field (insert>summary). These summaries can be copied to all group levels without creating new named objects (and repeating the logic).

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Ken,

I tried that before and it is not working for some reason. Something is causing my details to repeat.

When they repeat, the correct number of "HOUR" units paid is on the first detail, then following that, the summary field results in 0 and then some as 1.

I am totally lost and frustrated.
 
So the first thing you have to do is figure out how to identify the records that you want in your total without including the extra records. If you can find something different about these extra records then you can filter them out up front. If you can't figure out why you have these duplicates then you have to rebuild the report one table at a time to figure out the source. This link is my description of how to do that:


Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top