SIGN

The SIGN function returns the sign of a number or the result of a calculation.

Syntax

SIGN(
    number
)

Parameters
  • number: Real number or expression that returns a number.
Returned value

The SIGN function returns an integer.

Additional Information

The SIGN function returns 1 if the value resulting from evaluating the argument passed to the function is positive, 0 if it is zero, and -1 if it is negative.

Examples

If we have created the measures Total sales, adding the sales amounts, and Total cost, adding the manufacturing costs, we can create the following measure that tells us whether the set of records with sales information involved in the current context have generated a benefit or not:

sign = SIGN([Total sales] - [Total cost])

We can see it in operation if we create a visualization that shows, for example, the list of products and the measure created:

SIGN function. Example of use
Category
Mathematical and trigonometric
Submitted by admin on Tue, 01/15/2019 - 21:05