COMPARE TWO KEYVLAUES AND PROVIDE A SUMMARY¶
Compares two key-value maps across a specified set of keys and returns a summary of their differences. Supports raw difference, absolute difference, squared difference, and ratio comparison modes. Use this worker to quantify and surface discrepancies between two sets of named numeric or string metrics.
When to use¶
Classification: process.
Tagged: compare, delta, diff, key-value, keyvalue, ratio, summary.
Inputs¶
| Label | ID | Type | Default | Required | Description |
|---|---|---|---|---|---|
| Keyvalue 1 | kv1 | keyvalue | — | First key-value map to compare (e.g. simulation run A results or baseline metrics); leave empty only if comparison is not required. | |
| Keyvalue 2 | kv2 | keyvalue | — | Second key-value map to compare against kv1 (e.g. simulation run B results or target metrics); leave empty only if comparison is not required. | |
| Compare Keys | compare_keys | textarea | — | Newline- or comma-separated list of keys to compare across kv1 and kv2; use ‘A=>B’ notation to map a key named A in kv1 to a differently-named key B in kv2. Leave empty to compare all matching keys. | |
| Return Type | return_type | select | raw | Computation mode for each compared pair: ‘raw’ = kv2−kv1, ‘abs’ = /kv2−kv1/, ‘sq_diff’ = (kv2−kv1)², ‘ratio’ = kv2/kv1; defaults to ‘raw’. |
Outputs¶
| Label | ID | Type | Description |
|---|---|---|---|
| keyvalue_compare_output_1 | keyvalue_compare_output_1 | keyvalue | Key-value map containing the computed comparison result (raw diff, absolute diff, squared diff, or ratio) for each compared key pair. |
Disciplines¶
- data.dataset.transform
- data.statistics
Runnable example¶
A runnable example is registered for this worker. Open the example workflow on the d3VIEW canvas: /api/workflow/example?id=keyvalue_compare
Auto-generated from transformation schema. Worker id: keyvalue_compare. Schema hash: 03d4dd0b99ea. Hand-curated docs in workerexamples/ override this page when present.