| Math Formulas in Tabs3 Report Writer |
Each Tabs3 field and column is categorized as one of the following types of fields: alphanumeric, numeric, date or decimal. Only decimal fields/columns can be used in math formulas. Alphanumeric, numeric (i.e., non-decimal) and date fields cannot be used in math formulas.
Operators that can be used in a formula field include addition, subtraction, multiplication, division, and percentage.
Columns and fields are referred to by a single letter designator (C for columns and F for fields) followed by the column number or field number. For example, column #7 would be referred to as C7 and field #62 would be referred to as F62.
Previously defined columns can be used in a formula. For example, if you are defining Column 8, you can use columns 1 through 7 in the formula. The following is an example of a formula line:
C2 + C7
Note: Columns that are greater than the column number of the formula column cannot be used in the formula. For example, if you are defining Column 8, you cannot use C10 in the formula.
The F3 key can be used to display a list of defined columns when the cursor is in the Formula field.
You can also use a field in a formula. For example, let's say you want to use the Balance Due (field #116) in your formula but the balance due is not used in a previously defined column. If you are defining Column 8, you could enter:
F105 - C6
The F2 key can be used to display a list of available fields when the cursor is in the Formula field.
Note: Using a field vs. a column that is defined using the same field may not yield the same values. This is due to the fact that when defining work-in-process, billed and write-up/write-down columns, you have the ability to specify selection parameters such as beginning and ending date, tcode, timekeeper, cost type, etc. This note applies to field #'s 74-108.
Note: If a "field" and the multiplication or division operator are used in a formula, the column will not total. You can work around this by defining the field as a column (using a column number less than the column number of the formula column) that does not print. Use the column in your formula instead of the field.
Order of Operation
The order of calculations performed within a formula is as follows:
- All calculations within parentheses are performed first. In cases of nested parentheses, calculations within the innermost parentheses are performed first.
- All calculations outside of parentheses are performed from left to right. There is no hierarchy of operators. For example, in the calculation 4 + 3 * 2, the Report Writer calculates the answer as 14, not 10. If you want the answer to be calculated as 10, you would need to insert parentheses, 4 + (3 * 2).