SSRS Sign Function

The SSRS Sign function is a Mathematical function that returns the positive or negative sign of one, indicating the sign of an 8-bit signed integer. The syntax of the Sign function to verify whether the numeric field is positive or negative is as shown below.

=Sign(-15.4)
=Sign(10.56)

To demonstrate the Sign function, we use the Products table below, which has 14 records. The image shows the records in the table report; the result is in an empty column.

Source Table

SSRS Sign function Example

For this, right-click the textbox under the Result Header and choose the Expression to open the window below. The Sign function below will return 1 if the value in the Service Grade column is a positive value; otherwise, it returns -1 (negative value).

  1. SSRS Math Functions
  2. SSRS Charts
  3. Dashboard in SSRS
  4. SSRS
=Sign(Fields!Service_Grade.Value)
Sign Function expression

Similarly, let me create two more new columns to the right of the Sales column. The SSRS Sign function expression below returns 1 or -1 based on the subtraction result.

=Sign(Fields!SalesAmount.Value - Fields!StandardCost.Value)

Instead of writing + or – 1, you can convert a meaningful message if you use the SSRS IIF condition. For instance, the below code returns a Good for the positive result and a Bad for the negative sign.

=IIf(
Sign(Fields!SalesAmount.Value - Fields!StandardCost.Value) = 1,
"Good", "Bad")

Please click the preview tab to see the Sign report. Also, read about the SSRS Abs and SSRS Rnd methods from the list of available ones.

SSRS Sign Function to find number is positive or negative report