1. Home
  2. Estimating
  3. Expression Builder
  1. Home
  2. Needs Update
  3. Expression Builder

Expression Builder

Print Friendly, PDF & Email

The system supports formulas (mathematical expressions) to calculate quantities in the cost estimates of House Plans and Jobs.

Formulas can be compromised of the following elements:

    • Math Functions
    • Operators
    • Take Off Parameters
    • Trigonometric functions

You can either type them into the text area or drag them from the list or select and add using the button “Add to Formula”. You can further copy them and paste them into the appropriate place in the formula.

To validate the specified formula, click Test. If the formula is correct, the system highlights it green. To save the formula, click Process.

If the formula is incorrect, the system highlights it red and positions the mouse pointer next to the problem element.

Math Functions

You need to combine math functions with parameters. The parameter part should be enclosed within round brackets. The parameters part can contain other math functions (for example, Sqrt(Abs(-16)) ), Take Off Parameters (for example, Sqrt(KitchenLength) ).

abs(x) Abs returns the absolute value of the argument, X, for example, Abs(-10) returns 10.
ceil(x) Ceil returns the lowest integer greater than or equal to X. e.g.

    • Ceil(-2.8) = -2
    • Ceil(2.8) = 3
    • Ceil(-1.0) = -1
exp(x) Exp returns the value of e raised to the power of X, where e is the base of the natural logarithms.
floor(x) Floor to obtain the highest integer less than or equal to X. for example:

    • Floor(-2.8) = -3
    • Floor(2.8) = 2
    • Floor(-1.0) = -1
ln(x) Ln returns the natural logarithm (Ln(e) = 1) of the real-type expression X.
log(x) Log(x) calculates the log of x using base 10.
log(2,x) Log(2,x) calculates the log of x using base 2.
greatest (x,y) Greatest returns the higher value of its two operands. Each operand can be an expression. For example, Greatest(23+4, 23*2) = 46
least (x,y) Least returns the lower of its two operands. Each operand can be an expression. e.g. Least(23+4, 23*2) = 27
mod(y,x) Mod returns the remainder obtained by dividing its operands. In other words, x mod y = x – (x div y) * y.
pi Use Pi in mathematical calculations that require pi, the ratio of a circle’s circumference to its diameter. As it is a function it requires a parameter part, albeit it accepts null, i.e. Pi(). Pi is approximated as 3.1415926535897932385.

To return the area of a circle the expression would be Pi()*Radius^2 where Radius is a Take Off Param.

round(x) Round function rounds a real-type value to an integer-type value.
X is a real-type expression. Round returns an Int64 value that is the value of X rounded to the nearest whole number. If X is exactly halfway between two whole numbers, the result is always the even number. This method of rounding is often called “Banker’s Rounding”.If the rounded value of X is not within the Int64 range, an error is generated.
sqrt(x) Sqrt function returns the square root of the argument.
This can also be obtained by 16^0.5 = 4.
trunc(x) Trunc function calculates truncated value of X

Operators

Operators are the base arithmetic functions that you can use in your formulas.

* Multiply
/ Divide
+ Add
Subtract
( Open bracket
) Close bracket
^ Raise to the power of, e.g. 12^2 returns 144, 144^0.5 returns 12.

Take Off Params

Take Off Parameters (ToP’s) are any measurement (or amount) which you can use in your formulas to calculate quantities. The simplest example of the Take Off Parmaeter is FloorArea. You can further specify it as FloorAreaSlab and FloorAreaTimber.

The Take Off Parameter name can include A..Z, a..z, 0..9 and _. The system treats Take Off Parameters as case-insensitive, but try to enter them as you specify them in the Setup section.

FloorArea and ContractPrice are Take Off Parameters that are reserved by the system.

Trig Functions

Trigonometric functions are useful when you deal with angles. For example, when you need to find the sloping length of a roof where you have the RakeAngle (in degrees) and the Width the expression would be (Width/2)/Cos(DegToRad(RakeAngle)).

atan(x) Atan returns the arctangent of X.
cos(x) Cos returns the cosine of the angle X, where X is in radians. You can use the radians(x) function to convert degrees to radians.
In any right-angled triangle, the cosine of the angle = length of the adjacent side / length of the hypotenuse.
cos(radians(x)) This is a combination function which you can use to enclose another function with arguments. It returns the cosine from radians.
radians(x) Converts degrees to radians. This is useful as the base trig functions all take a parameter in radians.
sin(x) Sin returns the sine of the angle X, where X is in radians. Use radians(x) to convert degrees to radians.

In any right-angled triangle, the sine of the angle = length of the opposite side / length of the hypotenuse.

sin(radians(x)) This is a combination function which you can use to enclose another function with arguments. It returns the sine from radians.
tan(x) Tan returns the tangent of X. Tan(X) = Sin(X) / Cos(X).

In any right-angled triangle, the tangent of the angle = length of the opposite side / length of the adjacent side.

tan(radians(x)) This is a combination function which you can use to enclose another function with arguments. It returns the tangent from radians.

Note

The hypotenuse of a right-angled triangle is the longest side, which is the one opposite the right angle. The adjacent side is the side which is between the angle in question and the right angle. The opposite side is opposite the angle in question.
Updated on 5 November, 2021

Was this article helpful?

Related Articles