Do you know SAS, the business intelligence tool with the 60ies-charmes? If the day comes, when you need to find the first and second largest value from a set of observations, here is how it'd work:
proc summary data=&inputdataset.;
sum=idgroup(max(&variable.) out (&variable.)=)
Somehow idgroup and out do the trick. Why it works and what else to look after can be found in "Getting the Most from PROC MEANS" by Andrew H. Karp.
Commenting is closed for this article.