DATASET SORT BY DATASET¶
Sorts the rows of a primary dataset by the values of a specified column drawn from a second (reference) dataset, joining the two on a shared key column. Use this worker when row ordering must be driven by an external ranking signal rather than by a column already present in the target dataset.
When to use¶
Classification: process.
Tagged: dataset, external-key, join, order, process, rank, sort.
Inputs¶
| Label | ID | Type | Default | Required | Description |
|---|---|---|---|---|---|
| Choose Dataset | dataset_1 | dataset | — | Primary dataset whose rows will be reordered; must contain the column nominated as the join key (primary_key). | |
| Dataset 2 | dataset_2 | dataset | — | Reference dataset that supplies the sort values; must contain both the join key column and the sort column (sort_column). | |
| Primary Key | primary_key | scalar | — | Name of the column in dataset_1 (and the matching column in dataset_2) used to join the two datasets before sorting; populate from the dataset_1 column list. | |
| Sort Column | sort_column | scalar | — | Name of the column in dataset_2 whose values determine the final row order of dataset_1; populate from the dataset_2 column list. | |
| Choose Abs Value | use_abs_value | select | no | When set to ‘yes’, sorting is performed on the absolute value of sort_column rather than the signed value; default is ‘no’. | |
| Choose Order | order | select | desc | Sort direction applied to the sort_column values: ‘desc’ (largest first, default) or ‘asc’ (smallest first). | |
| Limit | limit | scalar | 0 | If less than zero, a factor of the max-min is used to determine which rows are to be included |
Outputs¶
| Label | ID | Type | Description |
|---|---|---|---|
| dataset_sort_by_dataset_output_1 | dataset_sort_by_dataset_output_1 | dataset | A copy of dataset_1 with its rows reordered according to the sort_column values from dataset_2, in the requested direction and with any row limit applied. |
Disciplines¶
- data.dataset.transform
Runnable example¶
A runnable example is registered for this worker. Open the example workflow on the d3VIEW canvas: /api/workflow/example?id=dataset_sort_by_dataset
Auto-generated from transformation schema. Worker id: dataset_sort_by_dataset. Schema hash: 50859ad83632. Hand-curated docs in workerexamples/ override this page when present.