Calculation field: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 62: Line 62:
Use the following syntax to get access to the values of Link to Entry and other linking fields:
Use the following syntax to get access to the values of Link to Entry and other linking fields:


<big><source lang="java">
<source lang="java">
#{link field name.child field name}
#{link field name.child field name}
</source></big>
</source>


where '''''link field name''''' is the name of a Link to Entry or similar field, '''''child field name''''' is the name of a field of a related entry.
where '''''link field name''''' is the name of a Link to Entry or similar field, '''''child field name''''' is the name of a field of a related entry.
Line 70: Line 70:
If a link field contains several links, then use an index (starting from zero) to get access to them:
If a link field contains several links, then use an index (starting from zero) to get access to them:


<big><source lang="java">
<source lang="java">
#{link field name@0.child field name}, #{link field name@1.child field name}, …  
#{link field name@0.child field name}, #{link field name@1.child field name}, …  
</source></big>
</source>


You can specify one of the supported aggregation functions instead of the index:
You can specify one of the supported aggregation functions instead of the index:


<big><source lang="java">
<source lang="java">
#{link field name@sum.child field name}
#{link field name@sum.child field name}
</source></big>
</source>


This expression returns the sum of values of field '''child field name''' for all entries included into '''link field name'''. The functions supported are: '''sum''', '''avg''', '''min''', and '''max'''.
This expression returns the sum of values of field '''child field name''' for all entries included into '''link field name'''. The functions supported are: '''sum''', '''avg''', '''min''', and '''max'''.

Navigation menu