Formula type Attribute
A formula Attribute can be used to calculate some numeric value, generate a text, or produce a logical result (market/unmarked symbol) from the values of other Attributes in the same registry. A formula can be constructed using texts, numbers, mathematical operations (and parentheses), functions and Attributes values. The following list shows what is allowed in a formula:
  • Texts: A formula that contains texts can only generate other texts. The only allowed operator is the sum (+) used to concatenate texts ("A" + "B" = "AB"). All values of the Attributes present in these formulas are converted to texts. Constant texts can also be inserted into the formulas by enclosing them in quotation marks: "Full Name: " + NAME + " " + LASTNAME, where NAME and LASTNAME are Attributes that contain the respective values for each registry.
  • Numbers: In a numeric constant the decimal separator (if necessary) should always be the dot (.). Do not use group separators for numbers greaters than 999. The minus sign could be used for negative numbers. The maximum number of decimal places must not exceed 8, and the total number of digits should not exceed 12.
  • Operations and parentheses:: Sum (+), subtraction (-), multiplication (*), division (/) and exponentiation (^). The terms could be arranged with parentheses.
  • Functions: Two conversion functions can be used: text (parameter) converts any value to text and num(parameter) converts a text to number, as long as the text is in the valid format of a number, as explained above.
  • Logical values: Logical attributes (marked/unmarked type) can be used in formulas that generate other logical values. In this case the allowed operations are: + (logical OR), * (logical AND), ^ (logical EXCLUSIVE OR/XOR), and - (INV or logical inversion, only as unary operator).
AT1, AT2, AT3 and AT4 are Attributes with numeric values, AT5 and AT6 are Attributes with text values, AT7 and AT8 are Attributes with logical values (marked/unmarked):
(3*AT1 + 2*AT2)/5 + AT3*2
-AT1 * (-AT2) - AT3 * AT5^2
AT1 + num(AT4*2) + num(AT5)/2
text(AT1) + ", " + AT4 + ", and" + AT5
-AT7 * -AT8
Formulas are calculated when the record is saved. When the result is numeric it is possible to define which decimal separator to display. Note that this is only the decimal separator of the result. The formula must always be constructed with the dot as the decimal separator.