Formulas start with a "=3D" or a formula prefix (any letter and number f= ollowed by a colon; the prefix is not interpreted yet, but will be used lat= er to separate different formula-namespaces).

=20=20=20

IMPORTANT:this is not the case for the formula def= ined in Pentaho Metadata nor Pentaho Data Integration. The "=3D" pref= ix should be omitted in that case.

Therefore the following formulas are equivalent:

=20=20

=3D1=20

=20

report:1=20

References to external data-fields are expressed using square brackets.<= /p>=20

=20

=3D[yourfield]=20

References to external data-fields *with parentheses in their titles<=
/em> are expressed using square brackets with quotation marks included insi=
de them.*

=20

=3D["yourfield (containing parentheses)"]=20

Possible operators are:

=20- =20
- Basic computation: +, -, *, / =20
- Percentage: % =20
- Power: ^ =20
- String-concatenation: & =20
- Comparisons: =3D, <>, <, <=3D, >, >=3D =20
- Formulas can have braces. =20

Example:

=20=20

=3D(1+1)*2 / 3=20

results in 1.3333333

=20=20

=3D10%=20

results in 0.1

=20String-constants are expressed using double-quotes.

=20=20

=3D"Your text here"=20

Strings can be concatenated using the & operator.

=20=20

=3D"Your text here " & "some more text"=20

The Range-Operators known from Spreadsheet applications are not supporte= d, as they have no meaning in the reporting. A formula can only work on the= current values of the current datarow. There is no way to access previous = or next rows of data. (These are the same limitations as with all expressio= ns, so this is nothing new.)

=20DATE - Provides an internal numb=
er for the given date.

DATEDIF - Returns the number of years, months, or days between two dates.

TIME - Returns the current time.

=
DATEVALUE - Returns date seria=
l number from given text.

NOW - =
Return the serial number of the current date and time. This returns the cur=
rent day and time serial number, using the * current locale.

TODAY - Returns the current date, (yyyy-mm-d=
d).

DAY - Returns the day of the=
month for a date (1 through 31)

M=
ONTH - Returns the month of a date

YEAR - Returns the year of a date

WEEKDAY - Returns the day of week from a date.

HOUR - Returns the hour (0 through 23) from a=
time.

AND - Returns TRUE if all argumen=
ts are TRUE.

FALSE - Defines the=
logical value as FALSE.

IF - Spe=
cifies a logical test to be performed.

NOT - Reverses the value of an argument.

OR - Returns TRUE if an arguments are TRUE.

TRUE - Defines the logical value as TRUE.

<=
a href=3D"/display/Reporting/XOR">XOR - Returns a value of TRUE only if=
just one of its operands is TRUE. In contrast, an inclusive OR operator re=
turns a value of TRUE if either or both of its operands are TRUE.

INT - Returns a number down to th= e nearest integer

=20SUM - Sum a list of numeric value=
s.

ABS - Returns the absolute (n=
onnegative) of the value.

AVERAG=
E - Average a list of numeric values.

ODD - Returns the rounding a number up to the nearest odd integer=
.

EVEN - Returns the rounding a=
number up to the nearest even integer.

MOD - Returns the remainder when one number is divided by another n=
umber.

MAX - Returns the maximum=
from a set of numbers.

MIN - Re=
turns the minimum from a set of numbers.

LEN - Returns the length in chara=
cters of the given value.

LOWER =
- Returns the given text in lower case.

UPPER - Returns the given text in upper case.

TRIM - Returns the given text free of leading and tr=
ailing spaces. Internal multiple spaces are replaced by one.

TEXT - Returns the given value as text.

<=
a href=3D"/display/Reporting/T">T - Returns the given text value or a z=
ero lenght string for non text type.

FIND - Returns the starting position of a given text.

EXACT - Reports if two text values are exactl=
y equal using a case-sensitive comparison.

REPT - Returns text repeated Count times..

MID - Returns extracted text, given an original text=
, starting position, and length.

LE=
FT - Returns a selected number of text characters from the left.

RIGHT - Returns a selected number of t=
ext characters from the right.

URLENCODE - Applies URL-Encoding to a text given in the first paramete=
r \

using the encoding specified in the second parameter. If no =
encoding is \

given, ISO-8859-1 is assumed.

REPLACE - Returns text where an old text is subs=
tituted with a new text within the start index and length range.

SUBSTITUTE - Returns text where an =
old text is substituted with a new text. If which is specified, only this o=
ccurrance will be replaced otherwise every occurrance will be replaced.

HASCHANGED - Checks, wheth=
er the columns specified by the given names has changed.

ISBLANK - Checks, whether the value is undefin=
ed (null).

NA - Returns the cons=
tant error NA.

ISNA - Tells if t=
he parameter is of error type NA.

ISLOGICAL - Checks whatever the value is of type Logical.

ISTEXT - Checks whatever the value is of =
type Text.

ISERR - Tells if th=
e parameter is of error type but returns false if the error is of type NA.<=
br> ISERROR - Tells if the parameter=
is of error type but returns false.

CHOOSE - Uses an index to return a value from a list of values.

=
ISREF - Checks whatever the value=
is a reference.

ISNUMBER -=
Checks whatever the value is of type Number.

ISODD - Checks whatever the value is an odd number.

ISEVEN - Checks whatever the value is an =
even number.

ISNONTEXT - Checks =
whatever the value is not of type Text.

Userdefined

NULL - Returns a=
NULL-Value

+ Add

- Subtract

* Multiply

/ Divide

=3D Equal

<&=
gt; Not Equal

< Less Than

> Greater Than

<=3D Equal Le=
ss Than

>=3D Equal Greater Than

& Concatenate

^ Power=20

% Percent (Suffix)

+ Positive (Prefix)

- Negative (Prefix)

=20

Note: The formula syntax used in LibFormula is based on= the OpenFormula standard. The full document is downloadable from Oasis: OASIS OpenFormula Spe= cifcation