Add median aggregate function

There is already an aggregate function to get the average, but I don’t see a way to get the median of an aggregate. Being able to get the median would be helpful for me to have a better representation of where the “middle of the data” is, since outliers can significantly skew the average.