Get latest patch installed using Relevance

Hi,

I have been using below relevance to determine the KB patches installed from the computers but would prefer to only focus on the last patch installed

Q: if (exists wmi) then ((string value of property “HotFixID” of it & " || " & string value of property “InstalledOn” of it) of select objects “HotFixID, InstalledOn from Win32_QuickFixEngineering where HotFixID != ‘File 1’” of wmi) as string else (“N/A”)

From below result:

A: KB4049065 || 2/3/2018
A: KB4535680 || 9/10/2021
A: KB4589210 || 3/13/2023
A: KB5001402 || 9/8/2021
A: KB5011570 || 4/7/2022
A: KB5014026 || 6/20/2022
A: KB5016058 || 7/19/2022
A: KB5017396 || 10/3/2022
A: KB5023788 || 5/18/2023
A: KB5027219 || 7/4/2023

Is there a way I could only get the below result only when I use the relevance script:
A: KB5027219 || 7/4/2023

Thanks.

Not sure if this approach is still vallid but worth a shot