Saul,
It sounds like you just want the max for the first field?
   gawk '/foo/{if (max < $1) max=$1} END {print $1}' file

But that doesn't seem likely since it's too simple - no offence intended.

Did you want the 2nd field of the row with the max of the first field?
   gawk '/foo/{if (max < $1) {max=$1;save3=$3} } END {print save3;}'

I'm ignoring the vertical bars because your example had spaces which awk 
recognizes by default.
If the spaces are not consistent then you might want to use -F.

You can probably find a good example of what you want
on http://commandlinefu.com

--
gsker at skerbitz.org

On Fri, 30 Oct 2015, Saul Alanis wrote:

> 
> I have a file with multiple fields;
> 
> 2 | foo | bar
> 4 | bar | foo
> 1 | bar | foo
> 3 | foo | bar
> 
> My goal is to sort the first field numerically and print the first field of the last result.
> 
> awk -F"|" '/foo/ {print $1 | "sort"}'
> 
> awk -F"|" '/foo/ {number=$1} END {print version}'
> 
> Help is greatly appreciated :)
> 
> SDA
> 
> 
>