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!

help with a formula for a group count

Status
Not open for further replies.

unknownly

Programmer
Jul 7, 2003
181
US
Inserted a Group#2b section and placed the "page header" fields here. report->change group expert->Group2->Options and checked "Repeat group header on each page." Then created two formulas:

{@pagereset} placed in the page header and suppressed:

whileprintingrecords;
numbervar grpcnt := 0;

{@grpcnt} placed in the Group#2b header and suppressed:

whileprintingrecords;
numbervar grpcnt;

if onfirstrecord or
{table.group3field} = previous({table.group3field}) then grpcnt := 1 else
if {table.group3field} <> previous ({table.group3field}) then grpcnt := 1 + grpcnt;

Then in format section->Group #2b Header->suppress->X+2 entered:

{@grpcnt} <> 1

Do this in order to get the pageheader once per page and it works until I noticed that if the same field value in group 2 but under different field value of Group 1 then
the {@grpcnt} will be 1 in that case the headers are print twice per page

Can anyone help me with this. Please!...

Thank you,

Sweetie
 
I understand what you're doing, I just don't grasp what you want to do as this seems to be a convoluted means to perform a count of a group.

And is this to be a running total shown on each page, or a reset running total?

If so, consider using a Running Total to do a distinct count at the appropriate level.

If not, just use a standard distinct count summary by right clicking the field and selecting insert->Summary->Distinct Count.

Otherwise rather than explainging what you're doing that isn't working, try describing your environment, including version info, example data and expected output.

-k
 
Iam doing this for the page headers. I don't want to using the Page header section to show the colum heading for the all the detail columns . So, I have inserted &quot;B&quot; section for each group and suppressing based on the parameter value enter by the user.


Thanks you,

Sweetie
 
Sweetie - Give us more information on your report. We cannot help you without it....a sample of current and expected output would be nice so we can &quot;see&quot; what is going on. I am with SV on this...you haven't given us enough info (ie. report grouping structure/sample output for us to advise you on anything.....sorry.

Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top