Skip to main content

sortStrings

Sorts a list of strings in alphabetical order.

To sort in reverse-alphabetical order, use sortStringsReverse instead.

Parameters

  • LIST (list, column, or row)

    The list of strings 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-string values.

Examples

To sort a list of strings in alphabetical order:

ATL in Script

Printed Result

[[

myList = makeList('Groucho', 'Harpo', 'Chico')

sortStrings(myList)

]]

Chico, Groucho and Harpo

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

[[Branch]]

Pittsburgh, Boston, Los Angeles and Chicago

[[sortStrings(Branch)]]

Boston, Chicago, Los Angeles and Pittsburgh

Note

In a "Describe Row in Context" project, the column variable would be BranchColumn.