Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

Integer values in calculations

Integer values in calculations

When you use integer values in calculations,
Data Integration
sometimes converts integer values to floating-point numbers before it performs the calculation.
For example, to evaluate
MOD( 12.00, 5 )
,
Data Integration
converts the integer value "5" to a floating-point number before it performs the division operation.
Data Integration
converts integer values to double or decimal values depending on how you set the
Enable High Precision
advanced session property in the
mapping
task.
Data Integration
converts integer values in the following arithmetic operations:
Operation
High Precision Disabled
High Precision Enabled
Functions and calculations that cannot introduce decimal points.
For example, integer addition, subtraction, and multiplication, and functions such as CUME and SUM.
No conversion.
However, if the calculation produces a result that is out of range,
Data Integration
writes a row error.
Decimal
Non-scientific functions and calculations that can introduce decimal points.
For example, integer division, and functions such as AVG, MEDIAN, and PERCENTILE.
Double
Decimal
All scientific functions and the EXP, LN, LOG, POWER, and SQRT functions.
Double
Double
The transformation Double datatype supports precision of up to 15 digits, while the Bigint datatype supports precision of up to 19 digits. Therefore, precision loss can occur in calculations that produce Bigint values with precision of more than 15 digits.
For example, an expression transformation contains the following calculation:
POWER( BIGINTVAL, EXPVAL )
Before it performs the calculation,
Data Integration
converts the inputs to the POWER function to double values. If the BIGINTVAL field contains the Bigint value 9223372036854775807,
Data Integration
converts this value to 9.22337203685478e+18, losing the last 4 digits of precision. If the EXPVAL field contains the value 1.0 and the result field is a Bigint, the calculation produces a row error because the result, 9223372036854780000, exceeds the maximum Bigint value.
When you use an Integer datatype in a calculation that can produce decimal values and you enable high precision,
Data Integration
converts the integer values to decimal values.
For transformations that support the Decimal datatype with precision up to 28 digits, precision loss does not occur in a calculation unless the result produces a value with precision greater than 28 digits in high precision mode. In this case,
Data Integration
stores the result as a double. If the field precision is less than or equal to 28 digits and the result produces a value greater than 28 digits in high precision mode,
Data Integration
rejects the row.

0 COMMENTS

We’d like to hear from you!