Filter for the latest record by ID

Hello, i have an index pattern with a “portfolio_id” and “validation_date”. both in string formats.
I only want to filter for the latest validation date for each ID. How am I able to do that in the “Query DSL” window?

portfolio_id validation_date
P10001 20220331
P10001 20220406
P10002 20220331
P10003 20220407

i only want to show those records in my data table.

Thanks in advance.