Extending this question and this one: In QGIS, there are special expression functions for the first and third quartile (q1
and q3
) and as well as median (median
). So it's easily possible to categorise the values of a field into the first 25% (the quarter of the features with the lowest values), the second quartile (25% to 50%) etc.
However, if I want to categorize not in categories of quartiles, but any arbitrary number of percentiles (e.g. "septiles": the first 7%, the second 7% etc.): how can I do that and assign a value to each feature that shows to which group it belongs?
Bonus: if I could set the range not to a fixed percentile, but define the "range" manually (like e.g. 0% to 7%, 7% to 19%, 19% to 23% etc.), that would be perfect.