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

Subtotalling with Global Variables

Status
Not open for further replies.

piazzab

Instructor
Oct 22, 2001
14
US
I have initialized a variable and increment it in the details section of the report. When I place a third subtotal variable in the footer, it doubles the last item twice. Here is my variables:

Group Header 2b:

whileprintingrecords;
global numbervar patinit030:=0;
patinit030;

Details Line:

whileprintingrecords;
Global numbervar patinit030 := patinit030 + {@0-30 Patient};
patinit030;

{0-30 Patient} = if Maximum ({@Days to Pay}, {Transctions111302.[Patient ID]}) <= 30 then tonumber({@subtotal by patient})

Group Footer 2:
whileprintingrecords;
global numbervar patinit030;
patinit030;

I am very frustrated and need to get this report to a client. UGGH!


 
I haven't seen this behavior before, so I'd guess that you have the details formula in the group footer too, so on the last row, it gets incremented by the last value one more time.

Or perhaps something like:

evaluateafter({@0-30 Patient});
whileprintingrecords;
Global numbervar patinit030 := patinit030 + {@0-30 Patient};
patinit030;

might help.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top