# DAT Fields - Step 2 - Adding Calculated Field

Calculated fields are dynamic formula-based fields added to a DAT Query in DAT FIelds - Step 2.

To add a new calculated field:
- Identify the numerical or character fields and their corresponding variable names listed in the first column of the grid.  Note:  You cannot mix character and numeric fields in a calculated field.  Note:  Even if the character field has numeric data, it is only eligible for character fields.  Example: The student Alternate Id field is a character field.  Even if you have numbers in this field, it is still only eligible for a character calculated field.
- Specify the desired formula below the grid using the variable names identified in the previous step. Example: A / 100 Example: A * B  Example: B +', ‘ + A

Note: Calculated fields can be constructed from other calculated fields.

Note:  For numeric fields, the type of number shown is determined by the type of numbers involved in the formula.  If only integer numbers are used, the result will be an integer number.  If a decimal number is used at any point, then the result will be a decimal number.  Example: Suppose A represents an integer column.  A / 100 will result in an integer value.  If the value for A is less than 100, the result will be 0.  Example:  Suppose A represents an integer column.  A / 100.0 will result in a value with decimals because the divisor is a decimal.

Note: The following characters may be used to create numeric calculated fields:

 ( ) Parenthesis controlling the order of mathematical operations. Note: Opening and closing parenthesis must match. + Addition - Subtraction * Multiplication / Division A-ZZ Variable names corresponding to an existing field.

Note: A calculated field may not be added if the resulting number is too large, too small, or results in an invalid mathematical result.  Example: Division by 0.

Note: The following characters may be used to create character calculated fields:

 ( ) Optional.  Parenthesis control the order of operations.  Note: Opening and closing parenthesis must match.  Note: Parenthesis are permitted but unnecessary for character calculated fields. + Concatenate characters or fields ' Use single quotes (apostrophes) to designate characters included in the calculated field.  Example: 'First: ‘ + A + ‘ Last: ‘ + B  Note: Apostrophes must always appear in pairs.  Note: Currently, it is not possible to include an apostrophe as a character in the calculated field. A-ZZ Variable names corresponding to an existing field.