According to the docs:
Returns the approximate boundaries for a group of expression values, where number represents the number of quantiles to create. This function returns an array of number + 1 elements, where the first element is the approximate minimum and the last element is the approximate maximum.
It sounds like if I want true quartiles, I need to use APPROX_QUANTILES(values, 4)
which will return [minvalue, 1st quartile, 2nd quartile, 3rd quartile, maxvalue]
As according to https://en.wikipedia.org/wiki/Quartile, quartile sets contain 3 data points - none of which is the min/max values of the data.
Is my assumption correct? Is APPROX_QUANTILES(values, 4)
going to return the true quartiles?
4
? – Falciform