textSort function
The textSort function sorts in ascending order the strings contained in each cell of a nominal attribute.
Parameters
textSort(column,ascending)
If you are using continuous attributes, check the Flow Execution Parameters.
Parameter | Description |
---|---|
column | The nominal attribute whose strings you want to sort. The column parameter is mandatory. |
ascending | Sets the order of the sort according to the following parameters: if it’s set as True, it sorts the strings in ascending order. If it’s set as False, it sorts the strings in descending order. If left empty or unspecified, the default parameter is True. |
Example
The following example uses the Adult dataset.
Description | Screenshot |
---|---|
In this example, we want to sort the characters of a nominal attribute in descending order. To achieve this goal we’re going to use the following formula:
And, in the screenshot we can see the results obtained, now in each cell of the education attribute letters have been sorted in descending order. |
|