﻿ Formula syntax in the Report Writer

## Formula syntax in the Report Writer

### Formula syntax in the Report Writer

A formula consists of operands, operators, numbers and parentheses.

• Operands are contained by apostrophes. You can use the following operands in a formula:
• Row numbers (e.g. '001' for row 001)
• Cells (e.g. 'TOTAL' for a certain sum in the report)
• Value or formula variables (e.g.'&1PERIK& 1PERIK)
• Cell names are alphanumeric, a maximum of 8 characters long and must begin with a letter.
• You directly enter numbers, with or without a decimal point (e.g. 100 or 2.5)

Example (Procentage variance):
('001'-'002')*100/'001'

• In addition to the basic operations of arthimetic + - * /, the following operators are supported:
Operator Example
ABS Absolute value ABS(-10) = 10
DIV Interger division 10 DIV 3 = 3
MOD Remainder of whole number division 10 MOD 3 = 1
SQRT Square root SQRT(9) = 3
INT Truncation to integer INT(3.9) = 3
TRUNC Truncation to integer TRUNC(3.9) = 3
ROUND Rounding ROUND(3.5) = 4
EXP Exponential function EXP(1) = 2.71828
LOG Logarithm LOG(10) = 2.3025
SIN, COS, TAN Trigonometric functions (angle of an arc)

Example (Variance of absolute values):
ABS('001') - ABS('002')

• Logical statement:
IF c1 THEN f1 ELSE f2
where c1 is comparison condition, f1 and f2 are formulas.
In comparison conditions the following operators are permitted:
 < less than <= less than or equal to > greater than >= greater than or equal to = equals

Example (Determine maximum value):
IF '001' > '002' THEN '001' ELSE '002'

### Note

• You can insert any amount of spaces between the parts of the formula.
• Formulas can refer to other formulas, that means formula rows are also allowed as operands.
• Previously, only variables could be evaluated in formulas, which were already contained in the report sets.