Dear Friends, I forgot to add, the idea is to aggregate the entire dataset based on year and get the median value for each of the columns. Hence the output should be like this Year X1 X2 X3 ............... 1991 10 20 30............... 1992 30 20 10............... 1993 4 5 6.............. . . . . . . . . . . . . 2005 100 200 300.......... Thanks and Regards Anup --------------------------------- [[alternative HTML version deleted]]