Skip to main content
All CollectionsTransformations
Transformation: Sort
Transformation: Sort

Use the Sort transformation to arrange dataset columns in ascending or descending order, with options for empty value placement.

Quin Eddy avatar
Written by Quin Eddy
Updated over a month ago

The Sort transformation in Nexadata Pipelines enables you to arrange data based on one or more columns with options for sorting direction and handling empty values. This transformation is useful for ordering data by specific criteria, such as organizing by name, performance score, or revenue, making it easier to analyze and report on prioritized information. You can configure the transformation using Natural Language Mode or Advanced Mode, depending on the level of control required.


Inputs for the Sort Transformation

  1. Name of the Transformation: In Natural Language Mode, the transformation name is automatically generated, but you can update it later in Advanced Mode. For example, you might rename it to something descriptive, like "Sort by Revenue Descending" or "Alphabetical Order by Department".

  2. Columns to Sort: Select one or more columns to use as sorting criteria. The transformation will arrange data based on these columns, prioritizing the first column selected as the primary sort key, followed by any additional columns in the selected order.

  3. Direction of Sorting: Choose whether to sort each selected column in Ascending or Descending order.

  4. Empty Values Handling: Decide where to place rows with empty values in the sorted output. Options include:

    • Top: Empty values appear at the beginning of the sorted list.

    • Bottom: Empty values appear at the end of the sorted list.


Using Natural Language Mode

In Natural Language Mode, simply describe how you want to sort the data, and Nexadata will automatically configure the transformation. The transformation name is auto-generated but can be modified later in Advanced Mode.

Example Instructions in Natural Language Mode

  • Sort by Employee_Last_Name in ascending order.

  • Arrange the dataset by Performance_Score in descending order, with empty values at the bottom.

  • Sort by Department alphabetically from A to Z.

  • Order the dataset by Total_Revenue in descending order.

  • Sort by Hire_Date in ascending order with empty values at the top.

Note: If Natural Language Mode doesn’t fully capture your requirements, you can switch to Advanced Mode for adjustments.


Using Advanced Mode

In Advanced Mode, you have complete control over the Sort transformation, allowing you to select multiple columns, sorting direction, and how to handle empty values. Advanced Mode allows for detailed control, ensuring the transformation precisely aligns with your analytical needs.

Steps in Advanced Mode

  1. Name of the Transformation: Enter or update a custom name, such as "Sort Employees by Last Name" or "Order Revenue Descending".

  2. Columns to Sort: Select one or more columns to serve as sorting criteria, such as "Employee_Last_Name", "Performance_Score", or "Hire_Date". If multiple columns are selected, they will be sorted in the specified sequence.

  3. Direction of Sorting: Specify Ascending or Descending for each selected column to control the order of sorting.

  4. Empty Values Handling: Choose whether empty values should appear at the Top or Bottom of the sorted output.


Example Use Case

The Sort transformation is ideal for prioritizing data by specific metrics. For example, suppose you have a Performance_Score column and want to rank employees from highest to lowest score, with empty values at the bottom. For example:

  • Transformation Name: Sort by Performance Score

  • Column to Sort: Performance_Score

  • Direction of Sorting: Descending

  • Empty Values Handling: Bottom

This configuration will sort employees by Performance_Score in descending order, placing rows with missing scores at the end.


Summary

The Sort transformation in Nexadata Pipelines enables efficient ordering of data by specified columns, with options for sorting direction and handling empty values. Use Natural Language Mode for a quick setup or Advanced Mode for detailed control. This transformation is ideal for arranging data based on custom criteria, making it easier to prioritize records for analysis.

Did this answer your question?