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 SSRS 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.
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).
=Sign(Fields!Service_Grade.Value)
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 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.