All standard aggregate functions are listed on this page.
An aggregate function call contains an expression in curly braces ("{}"), which is calculated for the item and all sub-items (or, in some cases, for other subset of related items in the structure), and then the resulting values are aggregated according to the meaning of the aggregate function.
An aggregate function may have modifiers, which are all listed here.
Aggregation Functions
SUM
Sum calculates numerical total for the values calculated for the item and/or its sub-items.
Note that when the value of the expression under aggregation is not numeric (cannot be converted to number), it is ignored.
If a certain issue (or another kind of item) is included multiple times in the sub-tree, the sum will include the value for that issue only once. This behavior can be overridden by #all modifier.
Accepts modifiers: #all, #children, #leaves, #strict.
COUNT
Count calculates count of defined (or truthy if #truthy modifier is specified) values for the item and/or its sub-items.
If a certain issue (or another kind of item) is included multiple times in the sub-tree, it will be counted only once. This behavior can be overridden by #all modifier.
Accepts modifiers: #all, #children, #leaves, #strict, #truthy.
AVG
Avg calculates an average of defined values for the item and/or its sub-items. The result for avg is generally the same as sum/count. Returns nothing in case there are no defined values for {x}.
If a certain issue (or another kind of item) is included multiple times in the sub-tree, the average value will include the value for that issue only once. This behavior can be overridden by #all modifier.
Accepts modifiers: #all, #children, #leaves, #strict.
MAX
Max calculates maximum of defined values for the item and/or its sub-items. Numeric, date, duration and text fields can be compared. Text fields are compared lexicographically.
Accepts modifiers: #children, #leaves, #strict.
MIN
Min calculates minimum of defined values for the item and/or its sub-items. Numeric, date, duration and text fields can be compared. Text fields are compared lexicographically.
Accepts modifiers: #children, #leaves, #strict.
JOIN
Join calculates concatenation of strings. If current row has children and #subtree modifier is set, join appends values for children wrapping them into characters (braces by default). Wrapping characters can be set by #beforeChildren and #afterChildren (see example for #subtree to see how it works). By default it joins all parent string values from root to self value.
Accepts modifiers: #ancestors, #subtree, #children, #leaves, #strict, #reverse, #separator, #beforeChildren, #afterChildren, #fromDepth, #toDepth.
PARENT
Parent extracts value from the parent row or from ancestor row by specified depth.
Accepts modifier: #depth.
Aggregation Modifiers
#all
When this modifier is accessible aggregation function applies to distinct items by default.
This modifier turns off distinct.
Can be used with: sum, count, avg.
#truthy
Only count row if subexpression produces truthy value.
Can be used with: count.
#strict
Do not process current row item as part of aggregation.
Cannot be used together with #children (it implies the same effect), #ancestors (use depth modifiers for that), #leaves (together they're useless).
Can be used with: sum, count, avg, join, min, max.
#children
Only process direct children of current row.
Can be used with: sum, count, avg, join, min, max.
#leaves
Only process leaves of subtree of current row.
Can be used with: sum, count, avg, join, min, max.
#subtree
Process whole subtree of current row. This is default behavior for sum, count, avg, min, max.
Can be used with: join.
#ancestors
Only process ancestors of current row. This is default behavior for join, parent.
Can be used with: join.
#reverse
Reverses the order of row processing.
Can be used with: join.
#separator
Defines separator for string joining. This modifier has string parameter, default is ", ".
Can be used with: join.
#beforeChildren
See #afterChildren.
#afterChildren
Defines exit separator between children and parent rows. This modifier has string parameter, default is "(" for #beforeChildren and ")" for #afterChildren.
Can be used with: join.
#fromDepth
Specifies position of the row that would be the first in sequence of rows aggregate function takes as an input.
Position is specified by integer parameter denoted as n below.
Positive values mean absolute depth of row in the structure, e.g. n=1 means root.
Negative values mean depth relative to current row, e.g. n=-1 is direct parent.
Default is 1. n shouldn't be 0.
This modifier doesn't work with any tree types except #ancestors.
Can be used with: join.
#toDepth
Specifies position of the row that would be the last in sequence of rows aggregate function takes as an input.
Position is specified by integer parameter denoted as n below.
Positive values mean absolute depth of row in the structure, e.g. n=1 means root.
Negative values mean depth relative to current row, e.g. n=-1 is direct parent.
Default is 0. 0 means current row.
This modifier doesn't work with any tree types except #ancestors.
Can be used with: join.
#depth
Denotes the parent that possesses value. This is specified via integer parameter denoted as n below.
Positive values mean absolute depth of row in the structure, e.g. n=1 means root.
Negative values mean depth relative to current row, e.g. n=-1 is direct parent.
Default is -1. n shouldn't be 0.
Can be used with: parent.