CONCAT() Function: combine several variables

Modified on Fri, 13 Feb at 8:50 AM

The CONCAT() function combines multiple values into a single string. It is useful for constructing clinically meaningful composite variables from existing data.


It can be used with:

  • List (categorical) variables

  • Numeric variables

  • Event variables

  • As part of a sub-expression inside another function


Syntax


CONCAT(value1, value2, ...)

All inputs are converted to text and concatenated in order.


Clinical Examples


1️⃣ Combining categorical variables

  • Side = Right

  • TearSeverity = Massive


CONCAT(Side, TearSeverity)

Result:

RightMassive


Important note: For List variables, a new modality RightMassive is automatically created if it does not already exist.


2️⃣ Combining numeric variables


CONCAT(1, 2)

Result:

12


3️⃣ Building a date string from numeric fields

If you store:

  • Day (numeric)

  • Month (numeric)

  • Year (numeric)


You can write:

EVENT(CONCAT(Day, '/', Month, '/', Year))

This creates a properly formatted date string that can be used inside another function such as EVENT().


Key Points

  • If used in a list dynamic variable, new concatenated modalities are created automatically.

  • It can be nested inside other expressions.


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