I have an {n x 3} list and wish to sort first by column 3 and then by column 2 and still maintain the first sort when I do the second sort. For example I have this list.
l = {{b, 98, 999}, {c, 75, 999}, {a, 100, 999}, {d, 67, 987}, {e, 98, 987}}
and using this sort does not do what I need it to do.
Sort[l,#1[[3]]>#2[[3]]&[[2]]>#2[[2]]&];
Column[l]
produces this output
{b,98,999}
{c,75,999}
{a,100,999}
{d,67,987}
{e,98,987}
I am trying to get this result
{a,100,999}
{b,98,999}
{c,75,999}
{e,98,987}
{d,67,987}
I have tried SortBy and cant get any closer, I have re-organised the rows so the numbers are first and still no success. Is this possible using the Sort command or will I have to resort to a more programmable way?