Configurable rolling percentile/quantile plot?

A rolling percentile (configurable window + percentile) as a chart line for wellness fields.
Use case: tracking a robust floor for HRV/readiness — a rolling minimum is too outlier-sensitive (one bad-wake-up day defines it), but a rolling 10th–20th percentile shows whether my typical worst days are improving, which I think is a better recovery-capacity signal than the average. Currently only min/avg/moving-avg are available.
I couldn’t find this plot in the available options when constructing custom chart.

If it’s already there, please point me to it.
Of course, any thoughts/suggestions/corrections are welcome.

Check out the HRV Status Chart from @Pieter

You can probably slightly adapt it to your wishes.

1 Like

Thank you!
Pretty sure I can create a formula to do exactly what I wanted.
I didn’t even know that was possible.

Just in case anyone come here looking for something similar:

1 Like

If anyone wants to know (or help me improve things), the expression I came up with (using Claude) is:

WIN = 42
PCT = 0.15

x    = KubiosReadiness ?? 0
buf  = x > 0 ? (cnt == 0 ? [x] : concat(buf, [x])) : buf
cnt  = x > 0 ? cnt + 1 : cnt

m    = cnt == 0 ? 0 : count(buf)
buf  = m > WIN ? buf[(m - WIN + 1):m] : buf
n    = cnt == 0 ? 0 : count(buf)
k    = max(1, round(PCT * n))
s    = cnt == 0 ? [0] : sort(buf, 'asc')

cnt == 0 ? 0 : mean(s[1:k])