Copy as Markdown View as Markdown (opens in new tab) View on GitHub (opens in new tab) Open in... ChatGPT (opens in new tab) Claude (opens in new tab) Perplexity (opens in new tab) avg avg(values: Array<Number>): Number Returns the average of numbers listed in an array. An array that is empty or that contains a non-numeric value results in an error. Parameters Name Description values The input array of numbers. Example This example returns the average of multiple arrays. Source %dw 2.0 output application/json --- { a: avg([1, 1000]), b: avg([1, 2, 3]) } Output { "a": 500.5, "b": 2 }