https://www.javacodegeeks.com/2015/01/how-to-emulate-the-median-aggregate-function-using-inverse-distribution-functions.html
How to Emulate the MEDIAN() Aggregate Function Using Inverse Distribution Functions