A number of interesting metrics would have a formula that involves sums of other formulas. For example, to calculate the % of bugs in a sub-tree, we'll need to divide the total number of bugs (calculated as a formula) by the total number of issues (also calculated as a formula).
It is possible to do that with the Formula column, but it's a bit tricky. You will need to use temporary additional Formula columns. The following instruction walks you through the creation of the BugFix % column, mentioned above, so that you can solve similar tasks.
We're aiming to make this instruction obsolete in a future version, where we'll introduce hierarchy aggregates right into the Expr language. |
In this walk-though, we will create a column that shows the % of bugs in a subtree. The formula is going to be something like (total number of bugs) / (total number of issues) .Main FormulaCreate a new Formula column and define the main formula. We're using total_bugs and total_issues as variable names, but they really could be anything. A few things to note:
Temporary Column with Total Number of BugsNow let's define a new column that shows the value of total_bugs. That is quite easy with the formula column.
Temporary Column with Total Number of IssuesIn the manner we create another temporary column that shows total number of issues.
Define Main Formula VariablesNow it's time to map the main formula's variables to the values calculated in the temporary columns. Go back to the main column configuration and click total_issues variable. In the attribute selector, scroll down to Used in Columns section and select "Formula" entry with the name of the temporary column in parentheses. Repeat the same for total_bugs.
Final StepsSelect Percent as the number format and it's all done! As a final clean-up, you can remove the temporary columns from the grid. Our Bugs % column has all the information it needs to do the calculation. |