sortNumbersReverse
Sorts a list of numbers in descending order.
To sort in ascending order, use sortNumbers instead.
Parameters
LIST(list, column, or row)
The list of numbers to sort.
Notes
You can give a row or column instead of a list.
The function returns an error if the input data contains non-numeric values.
Examples
To sort a list of numbers in descending order:
ATL in Script | Printed Result |
---|---|
[[ myList = makeList(10, 20, 15, 30, 25) sortNumbersReverse(myList) ]] | 30, 25, 20, 15 and 10 |
Assume a "Describe the Table" project with this data:
ID | Branch | State | Manager | Sales | |
---|---|---|---|---|---|
Row 1 | 1001 | Pittsburgh | Pennsylvania | Andrew Gray | 478,745.37 |
Row 2 | 1002 | Boston | Massachusetts | Emma Moore | 329,493.49 |
Row 3 | 1003 | Los Angeles | California | Linda Barclay | 467,359.45 |
Row 3 | 1004 | Chicago | Illinois | Camilla Scott | 463,603.17 |
You can input a column variable to the first parameter:
ATL in Script | Printed Result |
---|---|
| 478,745.37, 329,493.49, 467,359.45 and 463,603.17 |
| 478,745.37, 467,359.45, 463,603.17 and 329,493.49 |
Note
In a "Describe Row in Context" project, the column variable would be SalesColumn
.