SIGN Function

Computes the positive or negative sign of a given numeric value. The value can be a Decimal or Integer literal, a function returning Decimal or Integer, or a reference to a column containing numeric values.

For positive values, this function returns 1.

For negative values, this function returns -1.

For the value 0, this function returns 0.

Basic Usage

Column reference example:

derive type:single value:SIGN(MyInteger) as:'sign_MyInteger'

Output: Generates the new sign_MyInteger column containing the absolute value of each value found in the MyInteger column.

Numeric literal example:

delete row:(SIGN(MyInteger) == -1)

Output: Deletes all rows from the dataset in which the sign of the entry in the MyInteger column is -1. This transform remove all rows contain negative values in the MyInteger column.

Syntax

derive type:single value:SIGN(numeric_value)

Argument

Required?

Data Type

Description

numeric_value

Y

Decimal or Integer

Decimal or Integer literal, function returning Decimal or Integer, or name of column to apply to the function