---
title: "sort(columnNamed:byIncreasingOrder:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mldatatable/sort(columnnamed:byincreasingorder:)"
---

# sort(columnNamed:byIncreasingOrder:)

Creates a new data table by sorting the table by the given column.

## Declaration

```swift
func sort(columnNamed: String, byIncreasingOrder: Bool = true) -> MLDataTable
```

## Parameters

- `columnNamed`: The name of the column to sort the rows of data table.
- `byIncreasingOrder`: Set this value to doc://com.apple.documentation/documentation/Swift/true to sort the table in ascending order.

## Return Value

Return Value A new data table.
