Thanks for the update!
I have updated the example with few more values. How to display the first 2 (or more) results not just the biggest value and how to sort by first value1 and add value2 as a pair?
I suppose the values must be added to an array, sorted then display first, second, third etc. element of that array. Hash of hashes or hash of arrays are still unclear for me.
SUB2 has value1=2800 and value2=0.05
SUB3 has value1=2700 and value2=0.25