Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions

Transformation Language Reference

Transformation Language Reference

ABS

ABS

Returns the absolute value of a numeric value.

Syntax

ABS(
numeric_value
)
The following table describes the argument for this command:
Argument
Required/
Optional
Description
numeric_value
Required
Numeric datatype. Passes the values for which you want to return the absolute values. You can enter any valid transformation expression.

Return Value

Positive numeric value. ABS returns the same datatype as the numeric value passed as an argument. If you pass a Double, it returns a Double. Likewise, if you pass an Integer, it returns an Integer.
NULL if you pass a null value to the function.
If the return value is Decimal with precision greater than 15, you can enable high precision to ensure decimal precision up to 38 digits.

Example

The following expression returns the difference between two numbers as a positive value, regardless of which number is larger:
ABS( PRICE - COST )
PRICE
COST
RETURN VALUE
250
150
100
52
48
4
169.95
69.95
100
59.95
NULL
NULL
70
30
40
430
330
100
100
200
100

0 COMMENTS

We’d like to hear from you!