This page explains how to use the array_sort_desc function in APL.
array_sort_desc
function in APL to sort the elements of an array in descending order. This function is especially useful when working with numerical data or categorical data where you want to prioritize higher values first—such as showing the longest durations, highest response times, or most severe error codes at the top of an array.
You can use array_sort_desc
in scenarios where ordering matters within grouped aggregations, such as collecting response times per user or span durations per trace, and then sorting them to identify the highest or most impactful values.
Splunk SPL users
array_sort_desc
, but similar outcomes can be achieved using mvsort
with a custom sort order (and sometimes reverse
). In APL, array_sort_desc
explicitly performs a descending sort on array elements, making it more straightforward.ANSI SQL users
array_sort_desc
to sort them.Name | Type | Required | Description |
---|---|---|---|
array | array | ✔️ | The input array whose elements are sorted descending. |