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!

Running Total not resetting to zero

Status
Not open for further replies.

haydn

Technical User
Mar 16, 2002
40
GB
I have a simple running total. It sums the results of a pass/fail formula field which contains just 1's or 0's and evaluates using a formula. It then resets on change of field. Although it works OK when there are passes, when it finds nothing to count it does not reset to zero. I've tried playing with 'Convert NULL field-value to default' in both file and report options but it still remains stubbonly blank.
 
How can it find nothing to count if the "pass/fail formula field which contains just 1's or 0's"?

If there aren't rows, there isn't a group.

The evaluate use a formula is your culprit, you are likely eliminating all of the rows.

But it's unclear what you're doing, in one part you say it sums, in the next you say it finds nothing to count, those are very different functions.

You may have better results by just creating a formula in your group header, details and group footer sections which do the summing based on the evaluation formula, as in:

@header
whileprintingrecords;
numbervar MyCount :=0

@detail
whileprintingrecords;
numbervar MyCount;
If {table.field1} = <condition> or
{table.field2} = <condition> (etc.) then
MyCount:=MyCount+1

@footer
whileprintingrecords;
numbervar MyCount;
MyCount

-k
 
Thanks - I'll give it a try. I'm using 'sum' as I need to add up the number of passes - my use of 'counting' was perhaps unfortunate. The process is quite complicated and although there are '0's and '1's, I have to examine the lines before deciding whether to include them and I suspect it's this process which is causing the Running Total to misbehave.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top