Skip to main content
Skip table of contents

Logic DATs

On this page:

This section includes logical DATs such as If/Then statements and Decode statements.

If/Then Statements

Code

Description

Example

^(field;if.XX.then=YY)

A conditional argument that displays a specified result if the condition is met.

^(gender;if.f.then=female)

If the gender field contains f, display female.

^(ethnicity;if.fieldvalue.h.then=Hispanic;if.fieldvalue.#h.then=Non-hispanic)

If the ethnicity field contains h, then display Hispanic. If the ethnicity field does not contain h, then display Non-hispanic.

^(field;if.blank.then=)

A conditional argument that displays no result of the field is blank.

^(ethnicity;if.blank.then=Undisclosed)

If the gender field is blank, display Undisclosed.

^(field;if.fieldvalue.#XX.then=)

A conditional argument that displays no result if the value of the field does not meets the condition.

^(SAT;if.fieldvalue.#1600.then=)

If the SAT field does not contain 1600, do not display a result.

^(field;if.fieldvalue.XX.then=)

A conditional argument that displays no result if the value in the field meets the condition.

^(SAT;if.fieldvalue.400.then=)

If the SAT field contains 400, do not display a result.

^(field;if.not.blank.then=)

A conditional argument that displays no result if there is a value in the field.

^(SAT;if.not.blank.then=)

If the SAT field contains a value, do not display the value.

Decode

The Decode expression is used to evaluate a field against one or more specified values and return a result relative to each value.

Basic Format: ^(decode;fieldname;value;return;value;return;else)

Name

Code

Description

Fieldname

^(decode;Fieldname

^(decode;^(gender)

The name of the field to evaluate

Value

^(decode;Fieldname;Value

^(decode;^(gender);M

Evaluate the field against the specified value.

In this example, the field gender is evaluated against the value M.

Return

^(decode;Fieldname;Value;Return

^(decode;^(gender);M;Male

Value to return if the field matches the preceding value.

In this example, the value Male is returned if the gender field equals M.

Else

^(decode;Fieldname;Value;Return;Else)

^(decode;^(gender);M;Male;Female)

Default value to return if the current field value did not match any of the evaluated values.

The value Male is returned if the gender field equals M. Otherwise, the value Female is returned.

All parameters are required when using the decode DAT. Value and Return can be repeated to evaluate a field for multiple values.


Example #1: ^(decode;^(gender);M;Male;Female)

The value Male is returned if the gender field equals M. Otherwise, the value Female is returned.

Example #2: ^(decode;^(gender);M;Male;F;Female;Not Specified)

The value Male is returned if the gender field equals M. The value Female is returned if the gender field equals F. The value Not Specified is returned if the gender field does not equal M or F.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.