DECODE

Create descriptive versions of field data.

DECODE ( <field_name>, <val1>, <result1>, <val2>, <result2>, ... )

  • Field_Name - the name of the source to be used.

  • Val - the value to be substituted.

  • Result - the descriptive value to be applied.

    Values that are not matched will decode to Null.

Example: create a field on the Individual table that returns descriptive values for the Gender field.

DECODE ( [Individual].[Gender], 'M', 'Male', 'F', 'Female', 'U', 'Prefer not to Say')