Calculation field: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 367: Line 367:
Note that the function parameters are specified in single quotes.
Note that the function parameters are specified in single quotes.


=====
{| class="wikitable"
Function Arguments Returns
! Function !! Arguments !! Returns
$ sum fields, operation (optional, used if multiple fields are specified)
|-
fields - the path to the field or attribute of the associated record in the format: 'link_field_name.linked_field_name'
| $sum || fields, operation (optional, used if multiple argument fields are specified)
where link field name is the name of a link to an entry field.
| fields &{mdash;} the identifier of the field or attribute of the linked entry in the format: 'link_field_name.linked_field_name'
This function returns the sum of values ​​of the field.
In the function, you can pass the paths to several fields (attributes), in this case, before pairing, pairwise operations between fields (attributes) will be performed. The type of pairwise operation is determined by the last argument of the operation function and can be:
'@mul' - multiplication of fields (attributes).
'@add' - addition of fields (attributes).
'@sub' - subtraction of fields (attributes) from the field specified first.
'@div' is the division of the fields (attributes) into the field specified first.
The operation argument is optional, if it is not specified, then the multiplication operation is used
$ avg fields, operation This function returns the average value of a field.
$ min fields, operation This function returns the minimum of values ​​of the field.
$ max fields, operation This function returns the maximum of the values ​​of the field.


: where link_field_name is the name of a Link to Entry field.
: where linked_field_name is the name of a field of a linked entry.
If multiple attributes are received from the linked entries, the paired operation is performed before the summation takes place. The function returns the summation. The type of paired operation is defined by the last argument of the function operation(). The type of paired operation is determined by the last argument of the function operation()and can be one of the following:
* '@mul' - multiplication of fields (attributes).
* '@add' - addition of fields (attributes).
* '@sub' - subtraction of fields (attributes) from the field specified first.
* '@div' is the division of the fields (attributes) into the field specified first.
The operation() argument is optional. If it is not specified, then the multiplication operation is used as a default.
|-
| $avg || fields, operation || This function returns the average of values of field linked_field_name for all entries included into link_field_name.
|-
| $min || fields, operation || This function returns the minimum of values of field linked_field_name for all entries included into link_field_name.
|-
| $max || fields, operation || This function returns the maximum of values of field linked_field_name for all entries included into link_field_name.
|}
{{FieldNameHint}}
{{FieldNameHint}}


Navigation menu