cancel
Showing results for 
Search instead for 
Did you mean: 

How do I find the last 3 records of a group?

former_member279138
Participant
0 Kudos

I'm trying to find the last three records of each group (some groups will have 1 or 2 records only)

How do I do that?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Kurt,

1. Create a formula called @Selection with this code:

shared numbervar x := x + 1; 
COUNT({Any field on Details Section},{Field used as the Group}) - x;

2. Create a reset formula called @reset with this code and place this on the Group Header:

shared numbervar x := 0;

3. Go to the Section Expert > Highlight the Details Section (assuming that's where you've placed the records on) > Click the formula button beside Suppress and use this code:

{@Selection} > 2


-Abhilash

former_member279138
Participant
0 Kudos

Thanks! Do you know if it's possible to filter based on the results to see only trends.

In others words if all I'm interested in is to see whether something has happened three times.

What I would have is

Client 1

Date 1 A

Date 2 A

Date 3 C

Client 2

Date 1 C

Date 2 C

Date 3 A

Client 3

Date 1 A

Date 2 A

Date 3 A

But all I would see is

Client 3

Date 1 A

Date 2 A

Date 3 A

Because all I care about is if A happened 3 times in a row (over the last three occurances)