I\'m trying to do simple aggregate functions with the usual conditions. It works with quartile etc, but not average, median. What am I missing?