Skip to content

bmel:median-of

Category: Array & Statistics · Returns: bmel:number

Signature
bmel:median-of(array: bmel:array<number>)

Description

Returns the median (50th percentile) of all numeric values in an array. For even-length arrays, the average of the two middle values is returned. Equivalent to bmel:percentile-of(array, 50) but more readable when the intent is the median.

Arguments

Parameter Type Required Description
array bmel:array<number> The array of numeric values.

Examples

Median latency of a run
bmel:median-of({createChatCompletion:Response Payload[]}.$.latency_ms)
Median item price
bmel:median-of({getOrder:Response Payload}.$.items.price)

← Back to BMEL Reference