Concept: Sort Recipe

The Sort recipe allows you to sort the rows of an input dataset by the values of one or more columns in the dataset. In this example, our dataset provides customer information and includes a revenue prediction column.

../../_images/sort-before1.png

Our goal is to output a dataset sorted by predictions for each country.

By default, the Sort Recipe sorts columns in ascending order. In order to meet our business goal, we’ll change the sort option so that revenue predictions sort in descending order.

Next, let’s look at the defined sort order. Without changing the sort order, our output rows would be sorted by the value of prediction followed by the value of the country. To accomplish our objective, we’ll rearrange this order by dragging and dropping the columns in the configuration window.

The Sort Recipe provides options for making computations for each row. These options include asking DSS to compute the row number, rank of row, or dense rank of row. Selecting any of these options will create an additional column in the output dataset. Let’s select to compute the dense rank.

../../_images/sort-configured-denserank1.png

Finally, after running the recipe, our output dataset contains rows sorted by the customer’s country of origin, and the prediction of revenue. In addition, DSS has computed the dense rank for each row so that each row is ranked within its ordered group.

../../_images/sort-after1.png