Sorts the dataset based on one or more columns in ascending or descending order. You can also sort based on the order of rows when the dataset was created. 

Limitations:

NOTE: This transform is intended primarily for use in the Transformer page. Sort order may not be preserved in the output files.

sort order:LastName

Output: Dataset is sorted in alphabetically ascending order based on the values in the LastName column, assuming that the values are strings.

sort order:column_ref

TokenRequired?Data TypeDescription
sortYtransformName of the transform
orderYstringName of column or columns by which to sort

order

Required?Data Type
YesString (column name)

Data is sorted based on the data type of the source:   

Data Type of SourceSort Order
IntegerNumerical
DecimalNumerical
DatetimeNumerical
All othersString

Example - sort methods

Source:

The column without a name identifies the original row numbers. In the data grid, this information is available when you hover over the black dot to the left of a row of data. 

 CustIdFirstNameLastNameCityStateLastOrder
11001SkipJonesSan FranciscoCA25
21002AdamAllenOaklandCA1099
31003DavidWigginsOaklandMI125.25
41004AmandaGreenDetroitMI452.5
51005ColonelMustardLos AngelesCA950
61006PaulineHallSaginawMI432.22
71007SarahMillerCheyenneWY724.22
81008TeddySmithJuneauAK852.11
91009JoelleHigginsSacramentoCA100

Transformation:

First, you might want to clean up the number formatting in the lastOrder column. The following formats the values to always include two digits after the decimal point:

Now, you're interested in the highest value for your customers' most recent orders. You can apply the following sort:

Rows are sorted by the LastOrder column in descending order (largest to smallest):

 CustIdFirstNameLastNameCityStateLastOrder
21002AdamAllenOaklandCA1099.00
51005ColonelMustardLos AngelesCA950.00
81008TeddySmithJuneauAK852.11
71007SarahMillerCheyenneWY724.22
41004AmandaGreenDetroitMI452.50
61006PaulineHallSaginawMI432.22
31003DavidWigginsOaklandMI125.25
91009JoelleHigginsSacramentoCA100.00
11001SkipJonesSan FranciscoCA25.00

The above row numbers represent the original order of the rows. Now, you want to get your data geographically organized by sorting by city and state. You can perform multi-column sorts such as the following, which sorts first by State and then by City columns:

In the generated output, the data is first sorted by the State value. Each set of rows within the same State value is also sorted by the City value.

 CustIdFirstNameLastNameCityStateLastOrder
81008TeddySmithJuneauAK852.11
51005ColonelMustardLos AngelesCA950.00
21002AdamAllenOaklandCA1099.00
91009JoelleHigginsSacramentoCA100.00
11001SkipJonesSan FranciscoCA25.00
41004AmandaGreenDetroitMI452.50
31003DavidWigginsOaklandMI125.25
61006PaulineHallSaginawMI432.22
71007SarahMillerCheyenneWY724.22

Example - Sort by original row numbers