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

First and Tenth record only 1

Status
Not open for further replies.

Phillipg

Technical User
May 3, 2002
53
0
0
US
I have a group in a report called incident.statenumber (which is a string field) and would like to show the first and tenth occurrence in the group. I used in the group's header suppress formula section the following and it shows the tenth occurrence:
remainder(groupnumber, 10) <>0.
I also need the first occurrence.
Any help, thanks.

Phillipg
 
If you only have the one group, then change your suppression formula to:

if groupnumber <> 1 then
remainder(groupnumber, 10) <> 0

-LB


 
It works great on the first group and shows the first and every tenth record. It continues the count even when the group changes and continues the count and showing of every tenth record. I do indeed have more than one group, and I can't figure out how to reset the count when group #1 starts over. I need for it to start over when the group changes and show the first and every tenth record for that group. Most all groups have more than ten records in it but some may have less.
Thanks.

Phillipg
 
I am not sure what other data is in your report, but if you can move the data in the group header to the group footer, then you can use a Running Total that counts records, and is reset on the group and use it instead groupnumber to suppress the group footer.
 
Create two formulas:

//{@reset} to be placed in GH#1:
whileprintingrecords;
numbervar grpno := 0;

//{@grpno} to be placed in GH#2:
whileprintingrecords;
numbervar grpno := grpno + 1;

Then go to the section expert->GH#2->suppress->x+2 and enter:

not({@grpno} = 1) and
remainder({@grpno},10) <> 0

This assumes that you are trying to suppress all but the first and every 10th instance of Group #2 within Group #1.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top