Skip to main content
Skip table of contents

Items Calculated Attributes

Define calculations

Using the Calculated Attributes feature, you can build formulas dynamically using available dRofus fields to create additional fields. Calculated Attributes are available for Rooms, Items, Occurrences, and Products and allow you to build simple to very complex results. We explain how to do this for Room Calculated Attributes, Items Calculated Attributes, and Occurrence Calculated Attributes. The Calculated Attribute Formats are the same across dRofus. A good baseline understanding of how Item Composite Text Attributes work is a great place to start since the rules can be combined with these attributes.

You need admin access to the database to create calculated attributes, as the setup is done in the Administration settings. Please refer to Project and Database Administration.

Item If/Then Example

You might be familiar with if/then formulas if you have ever built complex rules in Excel. The syntax of IF-THEN is = IF (logic text, value if true, value if false). The first argument tells the function what to do if the comparison is valid. The second argument tells the function what to do if the comparison is false. A quick search on the internet will result in several examples of this concept. In our example, we will use several rules to pull from item data to inform some results. If you have ever tried to determine Door Calculations, you will want to bookmark this page and impress your office. Our team in Australia came up with this idea, and we all think it’s a great example of using item data to inform other decisions.

Here are the results of using the fields in blue (Item Data) to inform the results in red (Calculated Attributes).

All five examples have been grouped under Door Calculations using that Group label.

The following explains each example:

Clear Opening combines subtractions with if/then formula to determine the clear width available for any person or object to pass through when the door is fully open. The calculation considers the differing calculations if identified as a single or double door.

We begin with the Panel A and B widths; if Panel A is zero, we are not concerned about the door as the required dimension have not yet been nominated. Then, if Panel B width is zero, we assume the door is a single door; the calculation then subtracts the Panel thickness, Frame Stop, and Hinge Allowance from Panel A. Finally, if Panel B is not zero, we assume it is a double door, Panel A and B are added together, followed by the Panel thickness and Hinge Allowance being subtracted twice.

Clear opening width is often dictated by compliance standards involving accessibility; this example has the potential to identify non-compliant doors during the planning and design stages.

When scheduling frames for ordering, the Panel size is often not the key information, instead Reveal Height and Width are required; therefore, the following two examples could be helpful:

Reveal Height is the simple addition of Panel height and the Floor finish allowance; if necessary, panel undercut and Floor finish allowance could be incorporated separately.

Reveal Width is also an if/then formula and incorporates the rules of the panel width and the panel width clearance from the Item Data. This is an if/then within an if/then formula where the first rules are checked, followed by a second set of rules. If Panel A is zero, then the reveal width is zero. If the Panel A width is not zero a second, If/then is checked to see the condition of Panel B. If Panel B is zero, then add Panel A to the Panel width clearance, and If Panel B is not zero, then add Panel A to Panel B plus two Panel width clearances.

When doors are retrofitted or hosted in masonry walls, the structural opening size is required, the following two examples are a good examples of using a Calculated Attribute as a field:

Structural Height is defined using simple addition. The Reveal Height is added to the Frame architrave. But where is the Reveal Height coming from? That is another calculated attribute. Yes, you can build formulas on top of other formulas.

Structural Width is also defined by our first If/then formulas using Reveal Height. The rule is if the Panel B width equals zero, meaning it has no width (or there is no second panel), then combine the Revel width with the Frame architrave, AND if there is a Panel B width, add the Frame architrave twice to gain the additional width needed for both panels including the Panel B width.

These examples show how important project calculations can be provided to all users while simultaneously ensuring the calculations are performed.

Most calculated attributes are designed around numbers, and our default formulas create a bracket around the field {0} when building out a formula. But sometimes, we like to use text, yes/no, or list values. For example, when checking whether two text fields match or both values are True. For these formulas to work, you need to add a single quote around the bracket ‘{0}’ so that we know it should be a string, not a number.

These examples aim to give you a sense of what is possible using item calculations.





Returns the sum of two numeric operands. (Addition)

{0} + {1} ~ 0:1, 1:4 = 5


Returns the difference of two numeric operands. (Subtraction)

{0} - 4 ~ 0:10 = 6


Returns the product of two numeric operands. (Multiplication)

{0} * {1} ~ 0:2, 1:3 = 6


Returns the quotient of two numeric operands. (Division)

if ( {1} = 0, 0, {0} / {1} ) ~ 0:9, 1:3 = 3
Note: You need the IF part to avoid dividing by zero.


Indicates whether both operands are true.

{0} < 10 and {0} > 0 ~ 0:5 = True


Indicates whether either or both operands are true.

{0} < 2 or {0} >5 ~ 0:8 = True


Returns true if the logical operand is false.

not ({0} < 0) ~ 0:-5 = False


Indicates whether the left operand is equal to the right operand.

{0} = 4 ~ 0:4 = True


Indicates whether the left operand is not equal to the right operand.

{0} != {1} ~ 0:2, 1:4 = True


Indicates whether the left operand is less than the right operand.

{0} < 0 ~ 0:2 = False


Indicates whether the left operand is less than or equal to the right operand.

{0} <=2 ~ 0:2 = True


Indicates whether the left operand is greater than the right operand.

{0} > 0 ~ 0:8 = True


Indicates whether the left operand is greater than or equal to the right operand.

{0} >= 5 ~ 0:10 = True


Returns a value based on a condition

if ( {0} % {1} = 0, ‘Yes’, ‘No’ ) ~ 0:4, 1:2 = Yes


Returns whether an element is in a list of values.

in ( {0}, {1}, {2}, {3} ) ~ 0:7, 1:4, 2:7, 3:9 = True

In the example above, the first declared argument '{0}' is the value you want to evaluate, in this example, the number '7' as defined by the '0:7' after the (~).
The remaining arguments '{1},{2},{3}' define the list that {0} will be evaluated against.
In this case, the values are 4, 7, 9, since our initial value is '7' the function will return 'True' since 7 is included in the list we are evaluating against.


Returns true if the operand is null.

isNull ( {0} ) ~ 0: = True


Returns a slice of the provided text. The slice is decided by a start position and optional end position, starting from 0.

substring ( {0, 7) ~ 0:Doctor Rofus = Rofus
substring ( {0}, 0, 6) ~ 0:Doctor Rofus = Doctor


Returns true if the first text operand contains the second text operand.

contains ( {0}, {1} ) ~ 0:abc, 1:a = True


Returns the number of characters in the text.

length ( {0} ) ~ 0:Hello = 5


Replaces a substring in the first text operand. All matches of the second text operand are replaced with the third text operand.

replace ( {0}, {1}, {2} ) ~ 0:Hello, 1:l, 2:xx = Hexxo


Returns true if the first text operand starts with the second text operand.

startsWith ( {0}, {1} ) ~ 0:Hello, 1:H = True


Returns true if the first text operand ends with the second text operand.

endsWith ( {0}, {1} ) ~ 0:Hello, 1:o = True


Returns true if the first text operand contains a match using the second text operand as a regular expression.

regexIsMatch ( {0}, ‘a.*’ ) ~ 0:abc = True


Replaces a substring in the first text operand. All matches found using the second text operand as regular expression are replaced with the third text operand.

regexReplace ( {0}, ‘l+’, 'X' ) ~ 0:Hello = HeXo


Returns the value of a regular expression group. Group index starts from 1 and defaults to 1 if not given.

regexGroup ( {0}, ‘(1+)’ ) ~ 0:Hello = ll
regexGroup ( {0}, ‘(\\w+)\\s+car') ~ 0:One car red car blue car = One
regexGroup ( {0}, ‘\\w+\\s+(car')) ~ 0:One car red car blue car = car


Rounds a value to the nearest integer or specified number of decimal places.

Round ( {0}, 2) ~ 0:3.1415 = 3.14


Returns the largest integer less than or equal to the specified number.

Floor ( {0} ) ~ 0:1.5 = 1


Returns the smallest integer greater than or equal to the specified number.

Ceiling ( {0} ) ~ 0:1.5 = 2


Calculates the integral part of a number.

Truncate ( {0} ) ~ 0:3.14 = 3


Returns the absolute value of a specified number.

Abs ( {0} ) ~ 0:-1 = 1


Returns the smaller of two numbers.

Min ( {0}, {1} ) ~ 0:-4, 1:23 = -4


Returns the larger of two numbers.

Max ( {0}, {1} ) ~ 0:5, 1:8 = 8


Returns the square root of a specified number.

Sqrt ( {0} ) ~ 0:4 = 2


Returns a specified number raised to the specified power.

Pow ( {0}, 2) ~ 0:3 = 9


Returns e raised to the specified power

Exp ( {0} ) ~ 0:0 = 1


Returns the logarithm of a specified number.

Log ( {0}, 10) ~ 0:1 = 0


Returns the base 10 logarithm of a specified number.

Log10 ( {0} ) ~ 0:1 = 0


Returns a value indicating the sign of a number.

Sign ( {0} ) ~ 0:-10 = -1


Returns the sine of the specified angle.

Sin ( {0} ) ~ 0:0 = 0


Returns the cosine of the specified angle.

Cos ( {0} ) ~ 0:0 = 1


Returns the tangent fo the specified angle.

Tan ( {0} ) ~ 0:0 = 0


Returns the angle whose sine is the specified number.

Asin ( {0} ) ~ 0:0 = 0


Returns the angle whose cosine is the specified number.

Acos ( {0} ) ~ 0:1 = 0


Returns the angle whose tangent is the specified number.

Atan ( {0} ) ~ 0:0 = 0

Explore how to do this with Occurrence Calculated Attributes.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.