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!

Resetting manual counters on change of Group?

Status
Not open for further replies.

jaybar48

Technical User
Feb 16, 2002
61
US
How can I write a manual counter, using variable and "WhilePrintingRecords" that resets itself upon each change of group? I want to get a group count.

Thanks in advance.

Jay
 
Why not just use an inserted running total? Select count of any recurring field, reset on change of group. Place the running total in the group footer.

If for some reason you need the manual method, you need three formulas:

//{@reset} to be placed in the group header:
whileprintingrecords;
numbervar cnt;
if not inrepeatedgroupheader then
cnt := 0;

//{@accum} to be placed in the detail section:
whileprintingrecords;
numbervar cnt := cnt + 1;

//{@display} to be placed in the group footer:
whileprintingrecords;
numbervar cnt;

-LB
 
create a fromula using shared variable. and get ur totals here. create another formula with same shared variable and reset it here
 
lBass

The running total dialog box won't allow me to select the formula fields thata I need.

Jay
 
For a counter, why would you need a formula field? Please show the contents of the formulas and explain your report structure.

-LB
 
dmc: You specifically stated that LB use a variable here, why?

In future posts why not include technical information and requirements, rather than demand a certain architecture be used.

Just insert a Running Total andselect reset for each group if you just need counts in a group. You can add criteria to the Evaluate Use a Formula if it's conditional.

-k
 
lbass and others-

I did not post the details of the report, because I was not sure I could explain them as they get very convoluted, but I will try.

I am trying to count encounters under certain conditions in healthcare settings.

I have Grouped the data in the following manner:

Group 1- Service Category (Primary Care, Mental Health etc)
Group2 2- Healthcare Center Name
Group 3- Healthcare Center Program name

EncountersTarget=distinct Count of Encounter ID for the target month

Avg=Average number of encounters per month for the reporting period (usually one year.

LaggedProgram=YES when the number of encounters in the traget month for that program is less than 80% of the AVG

In the Report footer section, I have a counter for the total number of programs and the total number of programs that are laggeds.

I would like to have similar counters each time the service category changes, but I don't know how.

Jay
 
What formulas did you use to set up the laggeds in the report footer? If you used variables to do this, you would just create an additional variable with a different name where you reset it in the service category group header, as in my previous example.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top