System > pick by comparison
Is probably what you are looking for. If the variables can have any number (you don't know beforehand) you might have to do something like:
Pick all objects where variable is higher than current objects variable (system condition)
Pick lowest (object condition)