Formula property examples
Basic numeric formulas
Where the card property names are "Best", "Expected", "Worst" respectively and they have numeric values:
((Best * 2) + (Expected * 4) + (Worst * 2)) / 6giving twice as much weighting to the expected value than to the best or worst.
Formulas involving dates
Where the card property names are "Start Date" and "Duration" respectively:
"Start Date" + Durationresulting in a date which is [duration] number of days after the Start Date.
Where the card property names are "Start Date" and "End Date" respectively:
"Start Date" - "End Date"resulting in a number which is the number of days between Start Date and End Date.
Where the card property names are "Start Date" and "End Date" respectively:
("Start Date" - "End Date") / 7
resulting in a number which is the number of weeks between Start Date and End Date.
Where the card property name is "Planned Dev Days", and the rate of development yesterdays_weather would be replaced with the actual numeric value:
yesterdays_weather * "Planned Dev Days"
resulting in a number which is the number of points that may be expected given the developer days in the iteration and the current rate of delivery.
Where the card property name is "Estimate", and the rate of development yesterdays_weather would be replaced with the actual numeric value:
Estimate / yesterdays_weather
resulting in a number which is the number of days that the task may be expected to take to complete given the current rate of delivery.
Aggregate property formulas
Where the aggregate story card properties are, "Total Task Estimate" and "Completed Task Estimate":
"Completed Task Estimate"/"Total Task Estimate" * 100resulting in a number which is the % completeness of a story.
Where the aggregate feature card property "Total Estimate of Must Stories" is used with a numeric representing cost per point:
"Total Estimate of Must Stories" * 99resulting in a number which estimates the cost of the Must stories in a feature.
Replace any (not set) numeric properties with zero
The "Replace any (not set) numeric property values with zero" option allows you to specify how numeric property values that are (not set) will affect the calculated value of the formula. By default, if the value of any property within a formula is (not set) then the result of the formula calculation will be (not set). You can change this behavior to replace (not set) values with zero.
As an example, suppose you have a story card which has properties, "Development effort" and "Testing effort" and a formula property, "Story effort", with a formula of
"Development effort" + "Testing effort"The following table shows the result of the formula calculation for several different cards, depending on whether or not "Replace any (not set) numeric property values with zero" is selected.
| Card number | Development effort | Testing effort | Story effort - using (not set) | Story effort - replacing (not set) with zero |
|---|---|---|---|---|
| 43 | 3 | 1 | 4 | 4 |
| 44 | 3 | 0 | 3 | 3 |
| 45 | 0 | 1 | 1 | 1 |
| 46 | 0 | 0 | 0 | 0 |
| 47 | 3 | (not set) | (not set) | 3 |
| 48 | (not set) | 1 | (not set) | 1 |
| 49 | (not set) | (not set) | (not set) | 0 |
Card numbers 47-49 show cases where replacing (not set) with zero affects the formula result.
As shown above, date properties can be used in formulas. Date properties are not affected by the "Replace any (not set) numeric property values with zero" option. If a date property that is used in a formula is (not set) then the result of the formula is (not set). If both date and numeric properties are used in the formula, then the numeric properties can replace (not set) with zero, but the date properties will not. For example, the following formula, "Estimated completion" which has a date property, "Start date", and a numeric property, "Duration":
"Start date" + Duration
The result of the formula, with and without replacing (not set) with zero, is shown in the table below for several cards.
| Card number | Start date | Duration | Estimated completion - using (not set) | Estimated completion - replacing (not set) with zero |
|---|---|---|---|---|
| 71 | July 11, 2011 | 3 | July 14, 2011 | July 14, 2011 |
| 72 | July 11, 2011 | (not set) | (not set) | July 11, 2011 |
| 73 | (not set) | 3 | (not set) | (not set) |
| 74 | (not set) | (not set) | (not set) | (not set) |
Card number 72 shows the difference between when Duration does and does not replace (not set) with zero. Card number 73 shows that Start date is not affected by replacing (not set) with zero, because it is a date property.