Assigns a quartile by where a value sits within the full dataset's range of values (value-based, distribution-aware).
Larger values map to quartile 1. Internally the values are sorted and the 25th/50th/75th percentile cut points are derived via linear interpolation.
1
The value to classify.
The full population of values to compare against.
The quartile 1–4.
4
const revenues = rows.map((r) => r.revenue);quartileByValue(row.revenue, revenues); Copy
const revenues = rows.map((r) => r.revenue);quartileByValue(row.revenue, revenues);
Assigns a quartile by where a value sits within the full dataset's range of values (value-based, distribution-aware).
Larger values map to quartile
1. Internally the values are sorted and the 25th/50th/75th percentile cut points are derived via linear interpolation.