MAP_NUMERIC_TO_LIST(): convert a numeric code into a List value

Modified on Fri, 20 Feb at 10:27 AM

map_numeric_to_list() returns a List value by mapping a Numeric code to a reference List variable.
It is mainly used to standardize answers when the same question exists in multiple languages (or multiple versions), and you want one analysis-ready variable in a single reference language.


Syntax

map_numeric_to_list(NumericCode, ReferenceList)
  • NumericCode: a Numeric value (often produced by first_numeric_value())

  • ReferenceList: a List variable used as the mapping dictionary (the output will use its labels)

Return type: List (same structure and labels as ReferenceList)


How it works

map_numeric_to_list() searches the reference list for a modality whose numeric value matches NumericCode.

  • If a match is found → returns the corresponding List modality (with the reference labels)

  • If no match is found → returns null (shown as “NC” in the eCRF)

  • If NumericCode is null → returns null


Typical use case: build one analysis variable from a multilingual ePRO question

Example: Smoking status (List) in 3 languages

You collect the same question in multiple languages:

  • Smoking_EN (List)

  • Smoking_FR (List)

  • Smoking_DE (List)

Each List uses the same numeric codes:

  • 0 = Never smoked

  • 1 = Stopped smoking

  • 2 = Currently smoking

Patients answer only one variable, depending on their language.


Goal

Create one variable for analysis, always expressed using English labels:

  • Smoking (List, English)


Formula

Smoking = map_numeric_to_list( first_numeric_value(Smoking_EN, Smoking_FR, Smoking_DE), Smoking_EN )


What happens:

  1. first_numeric_value(...) returns the numeric code of the answered language variable (0/1/2)

  2. map_numeric_to_list(..., Smoking_EN) converts that code into the English List modality


Requirements and expected behavior

  • Numeric codes must be aligned across language-specific Lists.
    If “Stopped smoking” is 1 in Smoking_EN, then the equivalent modality must also be 1 in Smoking_FR and Smoking_DE.

  • If the numeric code does not exist in the reference list → result is null (displayed as “NC”).

  • If the numeric input is null → result is null (displayed as “NC”).


Practical tips

  • Use a stable reference list as the second argument (usually the language you want for statistics and exports, e.g., *_EN).

  • If you change the reference list structure or numeric codes, it can change the mapping result. Keep codes stable once your study is live.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article