Hello Lars,
In response to your question- while this could be done with scripting, it is not necessary.
A column formula can create an indicator. From this select matching, where the Flag=1. Then Tables menu> Subset, selected rows....
I will use sample data file Big Class, with "Age" as an ID that has duplicates. This is a ordinal value, but the same formula will work with characters.
We will flag the Minimum "Height" within the group of similar "age" in a similar way that you are looking for the minimum "amount" per "ID"
![GregF_JMP_0-1712669921406.png GregF_JMP_0-1712669921406.png](https://community.jmp.com/t5/image/serverpage/image-id/63209i601DC9C9573EA03F/image-size/large?v=v2&px=999)
These steps could be recorded with workflow builder in order to make a script.