Description
The sumAll
function enables the calculation of sums for a specified expression list. Optionally, subtasks can also be included in the calculation. This is especially useful for calculating aggregated values such as costs, time, or other numeric fields for main tasks and their subtasks.
Syntax
sumAll('expression', includeSubtasks)
Arguments
Argument | Description |
---|---|
expression |
The expression for which the sum is calculated. The expression can include various values or fields that should be summed. |
includeSubtasks (optional) |
An optional parameter that determines whether subtasks should be included in the calculation. true means subtasks are taken into account, false means only the main task is included in the calculation. |
Return Types
The function returns the sum of the specified expression. If includeSubtasks
is set to true
, the sum is calculated including all associated subtasks.
Example
Suppose you have a project with the main task called Marketing Campaign
and the following subtasks:
Task | Costs | Duration (hours) |
---|---|---|
Main Task: Marketing Campaign | 200 | 8 |
Subtask: Social Media Planning | 150 | 6 |
Subtask: Content Creation | 300 | 12 |
Subtask: Running Ads | 400 | 10 |
To calculate the total costs for the marketing campaign, including subtasks, use:
sumAll('Kosten', true)
Result: 1050
If you only want to consider the costs of the main task without subtasks, use:
sumAll('Kosten', false)
Result: 200
Similarly, you can calculate the total duration of the campaign:
sumAll('Dauer', true)
Result: 36
Comments
0 comments
Please sign in to leave a comment.