Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 09, 2017 at 04:29 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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)