Example of how to call the Abs function
As an example, let's take the following table of property details. This data contains the expected and actual sales prices of properties.
The actual sales prices maybe more with less than the expected sales price, and the example requirement is to determine whether the actual sales price falls within 10% of the expected value.
We can display the absolute difference between these two values by adding a gallery or data table control to a screen, and setting the Items property to the following formula:
As the following screenshot shows, the data table control correctly displays the difference between the two values.
How to calculate the variance as a percentage
As a logical extension of this formula, we can now add an extra column that displays the percentage variance from the expected sales price:
The screenshot beneath illustrates this output.
To determine if values falls within a certain tolerance level, we can call the Abs function. This post demonstrated how we can apply this function to table or collection of data.