Formula Builder Examples for Measures
Formula measures are created by building formulas in the Formula Builder. For an overview of the Formula builder, see The Formula Builder. This article describes how to create each of the visibility rules that are shown on the Example tab in the Formula Builder.
Note: The terms shown in several of the steps below are specific to this site. The terms on your site for things like Status Names and Metrics may be different based on your site.
1. Number Of Off-Track Projects In This Organization
- Click the Overview tab.
- From the first Aggregate drop-down menu, select NUMBER OF.
- From the second Aggregate drop-down menu, select NUMBER of x IN {Something} HAVING {Boolean} END.
- Click the green plus sign.
- Click the Projects tab.
1.1 Click hasStatus
- In the formula builder box, place your cursor inside the word "Something" inside the curly brackets.
- Click projectsOf.
- In the formula builder box, replace "Project" with "this".
- In the formula builder box, place your cursor inside the word "Boolean" inside the curly brackets.
- Click hasStatus.
1.2 Click The Green Plus Sign
- Click the Objects tab.
- In the formula builder box, replace "Project" with "x".
- From the Statuses drop-down menu, select the applicable status.
- In the formula builder box, place your cursor inside the word "Status" inside the curly brackets.
- Click the green plus sign.
1.3 Click OK
- Click OK.
2. Number Of Off-Track Projects In This Organization That Are A Specified Work Type
This formula will show the number of off-track projects with a specified work type in this organization.
- Click the Overview tab.
- In the first aggregate drop-down menu, select NUMBER OF.
- In the second aggregate drop-down menu, select NUMBER of x IN {Something} HAVING {Boolean} END.
- Click the green plus sign.
- Click the Projects tab.
2.1 Click hasStatus
- In the formula builder box, place your cursor inside the word "Something" inside the curly brackets.
- Click projectsOf.
- In the formula builder box, replace "Project" with "this, ".
- In the formula builder box, place your cursor inside the word "Boolean" inside the curly brackets.
- Click hasStatus.
2.2 Click The Green Plus Sign
- Click the Objects tab.
- From the Work Types drop-down menu, select the work type.
- In the formula builder box, place your cursor inside the parenthesis after "this, ".
- Click the green plus sign.
2.3 Click OK
- In the formula builder box, replace "Project" with "x".
- From the Statuses drop-down menu, select the applicable status.
- In the formula builder box, place your cursor inside the word "Status" inside the curly brackets.
- Click the green plus sign.
- Click OK.
3. Maximum Of The Scheduled Durations For All Projects In The Specified Portfolio
This formula will show the maximum of the scheduled durations for all projects in the specified portfolio. If the portfolio is empty, it will display 0.
- Click the Overview tab.
- From the first Aggregate drop-down menu, select MAX OF.
- From the second Aggregate drop-down menu, select MAX OF{Number} FOR x IN {Something} IFNONE {Number} END.
- Click the green plus sign.
- Click the Project Dates tab.
3.1 Click The Objects Tab
- In the formula builder box, place your cursor inside the word "Number" inside the curly brackets.
- Click scheduledDuration.
- Click the Objects tab.
3.2 Click OK
- In the formula builder box, replace "Project" with "x".
- In the formula builder box, replace "Number" with "0".
- From the Portfolios drop-down menu, select the portfolio.
- In the formula builder box, place your cursor inside the word "Something" inside the curly brackets.
- Click the green plus sign.
- Click OK.
4. Difference Between Planned And Actual Dates For A Portfolio
This formula will show the difference between planned and actual dates for a portfolio.
- In the formula builder box, type the text shown in the screen shot above.
- Click the Objects tab.
- From the Portfolios drop-down menu, select the portfolio.
- In the formula builder box, place your cursor after "myPortfolio = ".
- Click the green plus sign.
4.1 Click The Overview Tab
- Add a semicolon at the end of the MyPortfolio line.
- From the Periods drop-down menu, select the metric period.
- In the formula builder box, place your cursor after "period = ".
- Click the green plus sign.
- In the formula builder box, add a semicolon at the end of the period line.
- Click the Overview tab.
4.2 Click The Green Plus Sign
- In the first aggregate drop-down menu, select SUM OF.
- In the second aggregate drop-down menu, select SUM OF {Number} FOR x IN {Something} END.
- In the formula builder box, place your cursor after "totalPlanned = ".
- Click the green plus sign.
- In the formula builder box, add a semicolon add the end of the totalPlanned line.
- In the formula builder box, place your cursor after "totalActual = ".
- Click the green plus sign.
4.3 Click metricTotal
- In the formula builder box, add a semicolon add the end of the totalActual line.
- Click the Projects tab.
- In the formula builder box, for the totalPlanned line, place your cursor inside the word "Number" inside the curly brackets.
- Click metricTotal.
4.4 Click The Objects Tab
- In the formula builder box, for the totalActual line, place your cursor inside the word "Number" inside the curly brackets.
- Click metricTotal.
- Click the Objects tab.
4.5 Click The Green Plus Sign
- From the first Metric Items drop-down menu, select the metric template
- From the second Metric Items drop-down menu, select the metric view for the totaPlanned line.
- From the third Metric Items drop-down menu, select the metric line item.
- In the formula builder box, for the totalPlanned line, place your cursor inside the word "MetricItem" inside the curly brackets.
- Click the green plus sign.
- From the second Metric Items drop-down menu, select the metric view or the ActualPlanned line.
- In the formula builder box, for the actualPlanned line, place your cursor inside the word "MetricItem" inside the curly brackets.
- Click the green plus sign.
4.6 Click OK
- In the formula builder box, replace "Project" with "x" in both the totalPlanned and actualPlanned lines.
- In the formula builder box, replace "Period" with "period" in both the totalPlanned and actualPlanned lines.
- In the formula builder box, replace "Something" with "myPortfolio" in both the totalPlanned and actualPlanned lines.
- Click OK.