How to use the Sort Block
Sorting data can help the analyst to better understand the data in the data set. In general, if your table is too large to be sorted (more than 1M rows), you will need to filter the dataset down to reduce the number of values that need to be sorted.
1. Drag the Sort block to the canvas.
2. Connect the output node from the Calculate block to the input node of the Sort block.
3. Select the Sort block. At the bottom of the screen, you will have two sections - on the left, you have the columns of the data source, while on the right, you have the ones you want to use in your sorting.
4. From the list on the left, select the columns you want to use and click on the right arrow in the middle.
5. To remove the columns, select them on the right side and click the left arrow button.
6. To sort by a column, choose one from the right side and select “Ascending” or “Descending” from the Sort Direction.
7. You can also move columns up and down in the field order. The sort works in the following way:
- The whole document is sorted based on the column that is first on the list;
- The rest of the columns, from the second one onward, work as secondary sorts within the first one;
- In the example below, the document is sorted ascending, based on date. Then, for every date, the entries are listed ascending by country, as this is the second column added.
8. Click on the output node of the Sort block to see how the document looks like after the sort is applied.