DATASET SORT BY KEYVALUE¶
Sorts the rows of a dataset by matching each row’s primary-key value against a key-value map, then ordering by the corresponding numeric value. Use this worker to rank or reorder design variants, simulation cases, or any tabular data whose sort key lives in a separate key-value store rather than a native dataset column.
When to use¶
Classification: process.
Tagged: abs_value, dataset, filter, keyvalue, limit, order, ranking, sort.
Inputs¶
| Label | ID | Type | Default | Required | Description |
|---|---|---|---|---|---|
| Choose Dataset | dataset_1 | dataset | — | Input dataset whose rows will be sorted; each row must contain the column referenced by primary_key so it can be matched against the key-value map. | |
| Key Value | keyvalue_data | keyvalue | — | Key-value map supplying the sort metric: keys must correspond to values found in the primary_key column of dataset_1, and the associated values (numeric) determine the final row order. | |
| Primary Key | primary_key | scalar | name | Name of the dataset column used to join rows with keyvalue_data entries; defaults to ‘name’ and is auto-populated from the columns of dataset_1. | |
| Choose Abs Value | use_abs_value | select | no | Whether to sort on the absolute value of the key-value metric (‘yes’) or its raw signed value (‘no’, default); set to ‘yes’ when direction is irrelevant and only magnitude matters. | |
| Choose Order | order | select | desc | Sort direction applied to the key-value metric: ‘desc’ (default) places the largest values first, ‘asc’ places the smallest values first. | |
| Limit | limit | scalar | -1 | Maximum number of rows to retain in the output after sorting; set to -1 (default) to return all rows, or a positive integer to keep only the top-N ranked rows. |
Outputs¶
| Label | ID | Type | Description |
|---|---|---|---|
| dataset_sort_by_keyvalue_output_1 | dataset_sort_by_keyvalue_output_1 | dataset | Sorted (and optionally truncated) dataset in the same schema as dataset_1, with rows reordered according to the key-value metric, sort direction, and row limit specified. |
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_keyvalue
Auto-generated from transformation schema. Worker id: dataset_sort_by_keyvalue. Schema hash: 2ae5f0005d90. Hand-curated docs in workerexamples/ override this page when present.