*RETURNS BASED ON CONDITION. IF( VALUE1, VALUE1, OPERATOR, TRUE_VALUE, FALSE_VALUE) *¶
Evaluates a conditional expression — if(value_to_check, operator, target_value) — and returns one of two scalar results depending on whether the condition is true or false. Use this worker anywhere a branch decision must be encoded as a scalar value within a workflow, e.g. pass/fail labelling or threshold gating.
When to use¶
Classification: process.
Tagged: branch, comparison, conditional, if, logic, math, pass_fail, scalar.
Inputs¶
| Label | ID | Type | Default | Required | Description |
|---|---|---|---|---|---|
| Scalar | valuetocheck | scalar | — | The scalar value to be tested against the target; may be numeric or string depending on the chosen operator. | |
| Operator | operator | scalar | eq | Comparison operator to apply: ‘eq’ (equal), ‘gt’ (greater-than), ‘gte’ (greater-than-or-equal), ‘lt’ (less-than), ‘contains’ (substring match), ‘not_contains’ (substring exclusion), or ‘between’ (inclusive range); defaults to ‘eq’. | |
| Target Value | target_value | scalar | — | The reference value to compare against; for the ‘between’ operator supply a colon-separated range such as ‘2:4’ (inclusive bounds). | |
| True Value | true_value | scalar | yes | Scalar returned when the condition evaluates to true; defaults to ‘yes’. | |
| False Value | false_value | scalar | no | Scalar returned when the condition evaluates to false; defaults to ‘no’. |
Outputs¶
| Label | ID | Type | Description |
|---|---|---|---|
| math_if_output_1 | math_if_output_1 | scalar | Scalar result of the conditional evaluation — equals true_value when the condition holds, false_value otherwise. |
Disciplines¶
- data.dataset.transform
- platform.workflow
Runnable example¶
A runnable example is registered for this worker. Open the example workflow on the d3VIEW canvas: /api/workflow/example?id=math_if
Auto-generated from transformation schema. Worker id: math_if. Schema hash: e044748a868e. Hand-curated docs in workerexamples/ override this page when present.