{"id":858,"date":"2019-03-08T18:40:47","date_gmt":"2019-03-08T18:40:47","guid":{"rendered":"https:\/\/builder-help.gjgardner.com\/?page_id=858"},"modified":"2021-11-05T22:18:04","modified_gmt":"2021-11-05T22:18:04","slug":"expression-builder","status":"publish","type":"ht_kb","link":"http:\/\/help.gjgardner.com\/au\/hc\/estimating\/expression-builder\/","title":{"rendered":"Expression Builder"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">The system supports formulas (mathematical expressions) to calculate quantities in the cost estimates of House Plans and Jobs.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Formulas can be compromised of the following elements: <\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Math Functions <\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Operators <\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Take Off Parameters <\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Trigonometric functions<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">You can either type them into the text area or drag them from the list or select and add using the button &#8220;Add to Formula&#8221;. You can further copy them and paste them into the appropriate place in the formula.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To validate the specified formula, click <\/span><b>Test<\/b><span style=\"font-weight: 400;\">. If the formula is correct, the system highlights it green. To save the formula, click <\/span><b>Process<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If the formula is incorrect, the system highlights it red and positions the mouse pointer next to the problem element.<\/span><\/p>\n<h2><b>Math Functions<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">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) ).<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>abs(x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Abs returns the absolute value of the argument, X, for example, Abs(-10) returns 10.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>ceil(x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Ceil returns the lowest integer greater than or equal to X. e.g. <\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Ceil(-2.8) = -2 <\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Ceil(2.8) = 3<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Ceil(-1.0) = -1<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><b>exp(x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Exp returns the value of e raised to the power of X, where <\/span><b>e<\/b><span style=\"font-weight: 400;\"> is the base of the natural logarithms.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>floor(x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Floor to obtain the highest integer less than or equal to X. for example: <\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Floor(-2.8) = -3<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Floor(2.8) = 2<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Floor(-1.0) = -1<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><b>ln(x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Ln returns the natural logarithm (Ln(e) = 1) of the real-type expression X.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>log(x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Log(x) calculates the log of x using base 10.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>log(2,x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Log(2,x) calculates the log of x using base 2.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>greatest (x,y)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Greatest returns the higher value of its two operands. Each operand can be an expression. For example, Greatest(23+4, 23*2) = 46<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>least (x,y)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Least returns the lower of its two operands. Each operand can be an expression. e.g. Least<\/span><span style=\"font-weight: 400;\">(23+4, 23*2) = 27<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>mod(y,x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Mod returns the remainder obtained by dividing its operands. In other words, x mod y = x \u2013 (x div y) * y.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>pi<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Use Pi in mathematical calculations that require pi, the ratio of a circle&#8217;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.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To return the area of a circle the expression would be <\/span><i><span style=\"font-weight: 400;\">Pi()*Radius^2<\/span><\/i><span style=\"font-weight: 400;\"> where Radius is a Take Off Param.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>round(x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Round function rounds a real-type value to an integer-type value.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">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 \u201cBanker\u2019s Rounding\u201d.<\/span><span style=\"font-weight: 400;\">If the rounded value of X is not within the Int64 range, an error is generated.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>sqrt(x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Sqrt function returns the square root of the argument. <\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">This can also be obtained by 16^0.5 = 4.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>trunc(x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Trunc function c<span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Calculates truncated value of X&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:8961,&quot;3&quot;:{&quot;1&quot;:0},&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:10}\">alculates truncated value of X<\/span><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><b>Operators<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Operators are the base arithmetic functions that you can use in your formulas.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>*<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Multiply<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>\/<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Divide<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>+<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Add<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>&#8211;<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Subtract<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>(<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Open bracket<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Close bracket<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>^<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Raise to the power of, e.g. 12^2 returns 144, 144^0.5 returns 12.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><b>Take Off Params<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Take Off Parameters (ToP&#8217;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. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">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.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">FloorArea and ContractPrice are Take Off Parameters that are reserved by the system.<\/span><\/p>\n<h2><b>Trig Functions<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">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)).<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>atan(x)<\/b><\/td>\n<td><b>Atan<\/b><span style=\"font-weight: 400;\"> returns the arctangent of X.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>cos(x)<\/b><\/td>\n<td><b>Cos<\/b><span style=\"font-weight: 400;\"> returns the cosine of the angle X, where X is in radians. You can use the <\/span><b>radians(x)<\/b><span style=\"font-weight: 400;\">&nbsp;function to convert degrees to radians.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">In any right-angled triangle, the cosine of the angle = length of the adjacent side \/ length of the hypotenuse.<\/span><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-859\" src=\"\/wp-content\/uploads\/2019\/03\/cosynus.png\" alt=\"\" width=\"276\" height=\"193\"><\/td>\n<\/tr>\n<tr>\n<td><b>cos(radians(x))<\/b><\/td>\n<td><span style=\"font-weight: 400;\">This is a combination function which you can use to enclose another function with arguments. It returns the cosine from radians.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>radians(x)<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Converts degrees to radians. This is useful as the base trig functions all take a parameter in radians.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>sin(x)<\/b><\/td>\n<td><b>Sin<\/b><span style=\"font-weight: 400;\"> returns the sine of the angle X, where X is in radians. Use <\/span><b>radians(x)<\/b><span style=\"font-weight: 400;\">&nbsp;to convert degrees to radians.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In any right-angled triangle, the sine of the angle = length of the opposite side \/ length of the hypotenuse.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>sin(radians(x))<\/b><\/td>\n<td><span style=\"font-weight: 400;\">This is a combination function which you can use to enclose another function with arguments. It returns the sine from radians.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>tan(x)<\/b><\/td>\n<td><b>Tan<\/b><span style=\"font-weight: 400;\"> returns the tangent of X. Tan(X) = Sin(X) \/ Cos(X).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In any right-angled triangle, the tangent of the angle = length of the opposite side \/ length of the adjacent side.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>tan(radians(x))<\/b><\/td>\n<td><span style=\"font-weight: 400;\">This is a combination function which you can use to enclose another function with arguments. It returns the tangent from radians.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>Note<\/b><\/p>\n<pre><span style=\"font-weight: 400;\">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.<\/span><\/pre>","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>","protected":false},"author":21,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[29,95],"ht-kb-tag":[],"class_list":["post-858","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-estimating","ht_kb_category-needs-update"],"_links":{"self":[{"href":"https:\/\/help.gjgardner.com\/au\/wp-json\/wp\/v2\/ht-kb\/858"}],"collection":[{"href":"https:\/\/help.gjgardner.com\/au\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/help.gjgardner.com\/au\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/help.gjgardner.com\/au\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/help.gjgardner.com\/au\/wp-json\/wp\/v2\/comments?post=858"}],"version-history":[{"count":2,"href":"https:\/\/help.gjgardner.com\/au\/wp-json\/wp\/v2\/ht-kb\/858\/revisions"}],"predecessor-version":[{"id":7837,"href":"https:\/\/help.gjgardner.com\/au\/wp-json\/wp\/v2\/ht-kb\/858\/revisions\/7837"}],"wp:attachment":[{"href":"https:\/\/help.gjgardner.com\/au\/wp-json\/wp\/v2\/media?parent=858"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/help.gjgardner.com\/au\/wp-json\/wp\/v2\/ht-kb-category?post=858"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/help.gjgardner.com\/au\/wp-json\/wp\/v2\/ht-kb-tag?post=858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}