Sort Data
The Sort component organizes data within a dataset in ascending or descending order based on specified column values. It enhances data presentation and simplifies analysis by systematically rearranging data rows.
Sorting can be applied to numeric, textual, alphanumeric, or date-based columns, offering flexibility to meet specific user preferences and analytical needs.
Configuration
Upon clicking the Sort Data node, users are presented with the following fields in the configuration section:
Defining Sort Operation:
When the sort node is clicked, users can add sorting columns by clicking the Add button.
Each sorting column includes dropdown option to select the column and set the sorting order (ascending or descending).
Additionally, users can remove sorting conditions by clicking the Delete button.
Example Usage
Problem Statement: Let's consider a scenario to sort the employee data based on their department in ascending order, and within each department, we want to sort the employees based on their salary in descending order. This will help us identify the highest-paid employees within each department.
Dataset
Employee ID | Name | Age | Department | Salary |
|---|---|---|---|---|
101 | Alice | 30 | HR | 60000 |
102 | Bob | 28 | IT | 55000 |
103 | Charlie | 35 | Marketing | 70000 |
104 | David | 32 | Finance | 62000 |
105 | Emily | 27 | Operations | 58000 |
106 | Frank | 31 | HR | 62000 |
107 | Grace | 29 | Finance | 54000 |
108 | Henry | 33 | IT | 64000 |
109 | Irene | 26 | Marketing | 56000 |
110 | Jack | 34 | Operations | 61000 |
To accomplish this scenario using the Sort component:
Sort by Department (Ascending):
Click the +Add Column button to add sorting columns.
Choose the "Department" column from the dropdown menu.
Select ascending order to sort departments alphabetically.
Sort by Salary (Descending):
Click the +Add Column button again to add another sorting column.
Choose the "Salary" column from the dropdown menu.
Select descending order to sort salaries from highest to lowest.
Resultant Output
Employee ID | Name | Age | Department | Salary |
|---|---|---|---|---|
104 | David | 32 | Finance | 62000 |
107 | Grace | 29 | Finance | 54000 |
106 | Frank | 31 | HR | 62000 |
101 | Alice | 30 | HR | 60000 |
108 | Henry | 33 | IT | 64000 |
102 | Bob | 28 | IT | 55000 |
103 | Charlie | 35 | Marketing | 70000 |
109 | Irene | 26 | Marketing | 56000 |
110 | Jack | 34 | Operations | 61000 |
105 | Emily | 27 | Operations | 58000 |