Description
The function sumSubtask
enables the calculation of a sum based on a given expression exclusively for the subtasks of a task. This function is useful for calculating aggregated values only for the related subtasks.
Syntax
sumSubtask('expression')
Arguments
Argument | Description |
---|---|
expression |
The expression for which the sum is to be calculated. The expression can include various fields or flavors of the subtasks that are to be summed. |
Return Type
The function returns the sum of the specified expression for subtasks only.
Example (Standard Fields)
Assume you have a main task with the following subtasks:
Subtask | Actual Costs | Planned Costs |
---|---|---|
Planning | 200 | 5 |
Design | 500 | 10 |
Development | 1000 | 20 |
The fields Actual Costs
/ Planned Costs
are, in this example, two standard fields from the subtasks.
To calculate the sum of the Actual Costs
field from the subtasks, use:
sumSubtask('actualcosts')
Result: 1700
To calculate the sum of the Planned Costs
field from the subtasks, use:
sumSubtask('costs')
Result: 35
Example (Flavors)
Assume you have a main task with the following subtasks:
Subtask | Invoice Amount (net) |
---|---|
Invoice 1 | 200 |
Invoice 2 | 500 |
Invoice 3 | 1000 |
The field Invoice Amount (net)
is, in this example, a number-type flavor used in subtasks.
To calculate the sum of the flavor Invoice Amount (net)
from the subtasks, use:
sumSubtask('flavor("Invoice Amount (net)")')
Result: 1700
Comments
0 comments
Please sign in to leave a comment.