grunt> dump jn;
(k1,k4,10)
(k1,k5,15)
(k2,k4,9)
(k3,k4,16)
grunt> jn = group jn by $1;
grunt> dump jn;
(k4,{(k1,k4,10),(k2,k4,9),(k3,k4,16)})
(k5,{(k1,k5,15)})
Now, from here I want the following output :
(k4,{(k3,k4,16),(k1,k4,10)})
(k5,{(k1,k5,15)})
Bascially, I want to sort on the numbers : 10,9,16 and select the top 2 for every row.
How do I do it?