groupAgg
Description
The groupAgg
function allows the calculation of sums over multiple fields. Unlike the sumAll
function, the calculation is performed only once and not per task. The calculated value is cached and only recalculated when changes occur.
Syntax
groupAgg(Name, Function, [Condition], Fields, [Output])
Arguments
Argument | Description |
Name | A freely chosen name that serves as a key for the cache and must be unique per workspace. |
Function | Currently only Sum . |
Condition (optional) | Condition that specifies for which values the calculation is to be performed. If no condition is provided, the calculation is performed for all specified values. |
Fields | A comma-separated list of fields. The calculation is performed for all specified fields. The following options are available:
|
Output (optional) | Field name of the value to be output. If this parameter is omitted, no output is performed. The calculation is still carried out. |
Return Type
The return value depends on the aggregated fields. If no Output
parameter is set, the calculated value can be retrieved using groupGet
.
Example
groupAgg("SumJan24", "Sum", {if(flavor("shortDate")=="Jan 24 IST",1,0)}, "PSP Element=>IST Cost Amount", flavor("PSP"))
Note: Extended field support in groupAgg
The groupAgg
function now also supports the following standard fields in tasks:
actualcost
– Actual costcost
– Planned costactualduration
– Actual effortduration
– Planned effort
These field names can be used as usual in the function’s fields
parameter.
groupGet
Description
groupGet
returns the value of a previously calculated aggregation (groupAgg
) if no Output
parameter was specified in groupAgg
. Optionally, special values like #Count
or #Matching
can also be retrieved.
#Count
: The number of tasks that were calculated by the function#Matching
: The number of tasks that matched in the function
Syntax
groupGet(Name of the Aggregation, Value for which the Aggregation should be output)
Arguments
Argument | Description |
Name of the Aggregation | The name of the aggregation, as defined in groupAgg . |
Value | The specific value for which the aggregation should be output, e.g., a value from an aggregated field. |
Return Type
The return value can be numeric, such as a sum, count, or matching count depending on the retrieval.
Example
groupGet("SumJan24", "00-0200")
Combined Use of groupAgg
and groupGet
groupAgg("SumJan24", "Sum", {if(flavor("shortDate")=="Jan 24 IST",1,0)}, "PSP Element=>IST Cost Amount", flavor("PSP")) + ";" + groupGet("#Matching")
Comments
0 comments
Article is closed for comments.