...
Formulas start with a "=" or an formula prefix (any letter and number followed by a colon.) (not interpreted yet, will be used later to separate different formula-namespaces).
IMPORTANT: this is not the case for the formula defined in Pentaho Metadata nor Pentaho Data Integration. The "=" prefix should be omitted in that case.
Code Block |
---|
=1 |
Code Block |
---|
report:1 |
References to fields are expressed using square brackets.
Code Block |
---|
=[yourfield] |
Possible operators are:
Basic computation: +, -, *, /
Percentage: %
Power: ^
String-concatenation: &
Comparisons: =, <>, <, <=, >, >=
Formulas can have braces.
Code Block |
---|
=(1+1)*2 / 3 |
results in 1.3333333
Code Block |
---|
=10% |
results in 0.1
String-constants are expressed using double-quotes.
Code Block |
---|
="Your text here" |
Strings can be concatenated using the & operator.
Code Block |
---|
="Your text here " & "some more text" |
The Range-Operators are not supported. A formula can only work on the current values of the current datarow. There is no way to access previous or next columns. (These are the same limitations as with all expressions, so this is nothing new.)
...
Additionally, th report engine also provides the "ISEXPORTTYPE" function, which takes a single parameter specifiying the expected export type.
Code Block |
---|
=ISEXPORTTYPE("table"); |
returns true on any table-export.
Code Block |
---|
=ISEXPORTTYPE("table/html"); |
returns true on all HTML-exports.