Repeating Group - finding the latest date for each type

I have a data structure similar to this.

I have a table of cars which includes their name and other details.

I also have a table of registration expiration dates and other details.

For example:

Car Table

CarName Colour Make
Car A Red Mazda
Car B Blue Honda
Car C Yellow Nissan

Registration Details

Car Expiry Date Amount
Car A 31 January 2024 $500
Car A 31 January 2023 $450
Car C 12 July 2022 $300
Car A 31 January 2022 $440
Car B 20 March 2020 $250
Car B 20 March 2019 $225

I would like the repeating group to show the latest registration date for each car. For example:

Car A 31 January 2024
Car B 20 March 2020
Car C 12 July 2022

I feel this should be simple but I can’t get the appropriate RG data source so I must be missing something.
Currently it is:
Do a Search for CarRegistrations but I can’t find a Constraint to find the latest for each car
Any assistance would be appreciated.

1 Like

You won’t do it in the repeating group data source.

Your repeating group will display the list of cars (just it). And in the cell, you can display the name of the car + and use this search to get the latest registration: do a search for registration details (car=current cell's car, sorted by expiry date in descending order):first item's Expiry Date

3 Likes

Thank you so much for the reply. It sent me in the right direction. Seven days of frustration is now officially over!!