{
"group": "Percentiles",
"entries": [
{
"name": "Nearest-rank percentile",
"sentence": "Read one percentile of a numeric field across the collection.",
"query": "collection(${collection}) | percentile(.${field}; ${percentile})",
"change": "Change ${collection} to the quoted collection name, ${field} to the top-level numeric field and ${percentile} to a number from 0 to 100. The complete scan emits one nearest-rank JSON number, or null when no numbers exist. The head counts non-numbers as skipped. Zero selects the minimum. After group_by, write the percentile calculation in quoted jq over .values; this stage reads no group members.",
"defaults": {
"collection": "\"patients\"",
"field": "admitted",
"percentile": "95"
}
}
]
}