Sorts array values in the specified column, array literal, or function that returns an array in ascending or descending order. |
Array literal reference example:
arraysort([A,B,C,D],descending) |
Output: Returns the following array: [D,C,B,A]
.
Column reference example:
arraysort(myArrays,ascending) |
Output: Returns the arrays listed in the myArrays
column sorted in ascending order.
arraysort(array_ref,order_enum) |
Argument | Required? | Data Type | Description |
---|---|---|---|
array_ref | Y | string | Name of Array column, Array literal, or function returning an Array to apply to the function |
order_enum | Y | string (enumerated value) | Order is defined as either:
|
Name of the array column, array literal, or function returning an array whose array values you wish to sort.
Required? | Data Type | Example Value |
---|---|---|
Yes | String (column reference or function) or array literal | myArray1 |
String literal indicating the order by which the referenced arrays should be sorted:
ascending
- (default) lowest values for the valid data type are listed first. descending
- Null/empty values are sorted first, followed by mismatched values. Then, the array values that are valid for the specified data type are listed in descending order. Usage Notes:
Required? | Data Type | Example Value |
---|---|---|
No | String (enumerated value) | descending |