ORDERBYDESC function

Synopsis
This function sorts an array in descending order after applying an expression to each element .
Variations
ORDERBYDESC(SourceArray, Expression)
Returns all elements in the source array, sorted in descending order, after performing an expression on each element.
Parameters
SourceArray

Specifies the array to sort.

Supported types: Numeric array; String array; Boolean array; Point array; Object array.
Expression

Specifies the expression to apply to each element of the source array.

Supported types: Numeric; Boolean; String.
Returns
Returned types: Numeric array; String array; Boolean array; Point array; Object array.
Examples
1.

The following example sorts the source array in descending order after applying the expression to each element. The function returns the array [10, 8, 6, 4, 2].

ORDERBYDESC([2, 3, 5, 4, 1], Item*2)
2.

The following example returns an array of blobs ordered from largest to smallest area.

ORDERBYDESC(BlobAnalysis.BlobFound, Item.Area)