...
When this function is invoked, all of the values in the input array are passed to the corresponding columnar function. Some restrictions may apply. See AVERAGE Function.
Literal example:
d-codelang-syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value: |
---|
| LISTAVERAGElistaverage([0,0,2,4,6,8,10,12,14,16,18,20]) as:'myArrayAvg' |
|
listaverage([0,0,2,4,6,8,10,12,14,16,18,20]) |
Output: Generates an output column containing Returns the average of all values in the literal array: 19.1667
.
Column example:
d-code-lang-syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value: |
---|
| LISTAVERAGElistaverage(myArray) as:'myArrayAvg' |
|
listaverage(myArray) |
Output:
...
Returns the average of all values in the arrays of the myArray
column.
d-codelang-syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value: |
---|
| LISTAVERAGE |
listaverage(array_ref) |
Argument | Required? | Data Type | Description |
---|
array_ref | Y | String or Array | Array literal, reference to column containing arrays, or function returning an array |
...
Required? | Data Type | Example Value |
---|
Yes | String (column reference or function returning an array) Array (literal) | myArray |
...