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!

Inconsistent results in running total field (CR.NET)

Status
Not open for further replies.

lewser

Programmer
Oct 5, 2003
3
US
I have two running total fields, {#F1} and {#F2}, in my report that each calculate the sum of a database field, evaluating on change of group. While testing the report, I discovered that running the report off the same datasource (a table with a cached snapshot of data that is not updated) twice in succession would yield identical results for all my fields except the two running total fields.
I was able to trace this behavior to my grouping options. I erroneously assumed that sorting my group in its original order would save a bit of time, but as a result, my running totals would evaluate multiple times for a particular group if the detail records for that group were not together. I changed the group options so that groups were kept together and sorted in ascending (could have just as easily been descending) order.
As expected, this solved the problem for one of the running total fields, {#F1}. I can now run the report several times in succession, and the result for {#F1) remains consistent. However, the value for {#F2} is returned as any of four values, ranging from 3709 to 3773.
By all appearances, {#F1} and {#F2} should be computed identically, save for the field value which is being summed. Each is a sum, evaluated on change of group, never reset, placed in the report footer. Can anyone lend any insight into this behavior? Obviously I can't publish reports that may contain incorrect data.

Thanks in advance,
Lew
 
I'd suggest writing a subreport and putting it in your report footer. Have it do the summation you want, without regard to what the main report shows.

The quickest way to do this would be to save your report under another name, simplify it to get rid of everything but the totals, create a pseudo-group including everything and put the running totals in the group footer.

Then import this modified report as a subreport to the main report. It should do the trick.

Madawc Williams
East Anglia, Great Britain
 
Actually you don't need a pseudo-group, just put the running totals in the report footer of the modified report.

Madawc Williams
East Anglia, Great Britain
 
Turns out it was bad data in three of the groups - hence the four different values for {#F2}.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top