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!

OnLastRecord in a Group? 1

Status
Not open for further replies.

ToneV

MIS
Oct 29, 2003
19
US
I am trying to suppress all but the last record of each group. Is it possible to write a formula to select the last record (OnLastRecord) of each group, rather than the last record of the entire report?

Thanks
 
Place the fields in the group footer, that's the last record.

Perhaps you can share example data and expected output if you need more.

-k
 
It is actually a group within a group within a group, so it makes it a little more difficult. Basically, the easiest solution that I can think of (if it were possible) is to create a running count to count each record within the group:

whileprintingrecords;
numbervar counter := counter + 1;

I then reset the counter on the next group. I would like to suppress everything in the group except for the Maximum{counter} or NthLargest(1, {counter},....). I get "Field cannot be summarized."
 
ToneV-

I think your missing SV's point. If you move the fields that you would normally put in your Detail section, into your inner most Group Footer (GF3 based upon your second post), only the last record for each group will print.

~Brian
 
Drop the fields into whatever group footer, and that's the last row for that grouping.

You can use a record selection formula->Group to limit rows too.

I'll elaborate on this if you post technical information, otherwise I'll leave it to others with adequate time to drag it out of you.

-k
 
I guess I wasn't clear. Sorry. I am actually trying to suppress the footer, so If I moved everything to that footer, I will be supressing everything. The layout looks like this:

GH1
GH2
GH3
Da
Db
Dc
GF3 Running Totals in this footer.
GF2
GF1

I need suppress everything but the last GF3 Footer before GH1 begins again. I hope this makes sense!
 
It's difficult to imagine a situation that would call for this kind of suppression--unless maybe group 3 is based on a datefield? Anyway, if you mean you have a setup like this:

GH1
GH2
GH3
details
GF3 //suppress this
GH3
details
GF3 //suppress this
GH3
details
GF3 //Do not suppress this
GF2
GF1

Then create a running total {#grpcnt} using the running total editor by selecting the Group 3 field, distinctcount, evaluate for every record, reset on change of group 3. Place this in the Group Footer #3. Then go to format section->Group footer #3->suppress->x+2 and enter:

distinctcount({table.group3field}, {table.group3field}) <>{#grpcnt}

This should suppress all group 3 footers except the last one.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top