RECODE
Requires: Write access to configure a questionnaire calculation.
Maps numeric answer values to other numbers using a lookup table. Input: selected numeric values or lists. Output: one mapped list per input, preserving its order and length. Every value is processed; there is no separate Per item setting.
Configure a mapping
- Add
RECODEand explicitly select the question references to map. - Under Value mapping, select Add mapping for each rule. Enter the original number in Value and its replacement in becomes.
- Leave Create unique key off to replace the selected values within this pipeline. Turn it on to retain the originals and produce additional references ending in
_RECODE. - Save and test with synthetic answers. Check the result notes as well as the numbers.
Example: rules 2 → 1, 4 → 2, 6 → 3 turn [2, 4, 6] into [1, 2, 3]. A following ADD using only those mapped inputs produces 6. These are configuration examples, not clinical scoring rules.
Unmatched values and rule order
A value without a matching rule passes through unchanged and is noted in the result. With no rules, all values pass through and a note reports the missing mapping. Neither case silently removes an answer or replaces it with zero.
The first matching rule wins. Duplicate source values are reported as shadowed rules; adding a later row does not override an earlier one. Matching uses a numeric tolerance of less than 0.0001, rather than rounding values to integers.
RECODE maps every element of a list. Replacing an older calculation built from comparisons can therefore change results for multiple answers, since comparison operators use only the first number. Test such a change before updating past results.