Difference between revisions of "Calculation field"

From Memento Database Wiki
Jump to navigation Jump to search
Line 8: Line 8:
 
== Variables ==
 
== Variables ==
 
Variables are values of other fields in the same record.<br />
 
Variables are values of other fields in the same record.<br />
Variable must be enclosed by a pound sign and open brace #{ and a closed brace }. i.e. expression = "#{field_name1} + #{field_name2}"
+
Variable must be enclosed by a pound sign and open brace #{ and a closed brace }. i.e. expression
 +
<source lang="java">
 +
"#{field_name1} + #{field_name2}"
 +
</source>
  
 
String values/variables must be enclosed by Quote characters:
 
String values/variables must be enclosed by Quote characters:
<source>
+
<source lang="java">
 
'Result: ' + '#{string_field1}' + '#{string_field2}'
 
'Result: ' + '#{string_field1}' + '#{string_field2}'
 
</source>
 
</source>

Revision as of 06:43, 22 July 2016

The values in the calculation fields are calculated from the expressions specified by you.
The following types of expressions are supported:

  • Mathematical - Expression involving numbers.
  • String - String can also be added together, compared, etc...
  • Boolean - Expression that evaluate to true (1.0) and false (0.0).
  • Numeric and string types can not be mixed in a left / right operand pair.

Variables

Variables are values of other fields in the same record.
Variable must be enclosed by a pound sign and open brace #{ and a closed brace }. i.e. expression

"#{field_name1} + #{field_name2}"

String values/variables must be enclosed by Quote characters:

'Result: ' + '#{string_field1}' + '#{string_field2}'