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

Can't Get Correct Running Total

Status
Not open for further replies.

MikeCopeland

Programmer
May 21, 2007
91
US
Using CR XI...
I am unable to get the correct Running Total of a function. Here's my function:

// @numGraduate
WhileReadingRecords;
if({CBSIntakeDischarge.ReasonGraduate} = 1) then 1 else 0

When I group data records (as I must in this report), I print this function's value out on the Group #1 line - and it appears correctly. However, when I create a Running Total on this value - and Break on the Group name - the Running Total is far different (11) than the count of "1's" I manually count (16).
For debugging purposes I inserted the #totGraduate field on my Group #1 line, and it displays the problem: the Running Total never changes when the "1" is displayed, but many records after it. Thus, although I have 16 lines with the "1" displayed, the Running Total shows 0..11, never changing when the record shows it should and obviously reaching to proper total.
I've tried changing my formula to "WhilePrintingRecords;", but CR won't let me do that with the Running Total #totGraduate active. I don't know if this would solve the problem (it might...), but since I can't try it the problem remains.
Is there any way to compute a "running total" on a function that produces a "yes/no" value during the printing phase? Please advise... TIA

 
My apologies for the delay in replying, but I'm at my "work" (volunteer) location infrequently - I just returned. 8<{{
- Field to Summarize: @numGraduate (the formula above)
- Type of Summary: sum
- Evaluate On Change of Group: @clientName - A
- Reset: Never

// @clientName
WhileReadingRecords;
ProperCase(Trim({Clients.ClientLastName}) + ", " + Trim ({Clients.ClientFirstName}))

Does this complete my query? 8<}}
 
The running total will only be correct in the report footer. You should see it accumulating if you place it in the clientname group header.

You can leave the whilereadingrecords off both formulas.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top