This page covers:
Related pages:
Calculated Indicators in Amp Impact
Calculated Indicators enable organizations to perform mathematical calculations from two or more source Project Indicators. For example, an organization might need to track the percentage of a population that was vaccinated with the formula (Number of people vaccinated/Total population)* 100. In this example, they used the results from two other (source) Project Indicators to perform the calculation.
Amp Impact comes with two options for displaying and managing Calculated Result data: Visualforce and Lightning Web Component. Depending on which option your organization uses, you would need to navigate to different sections to ensure the steps outlined here corresponds with what you’ll see in your system. Check with your System Administrator if you’re unsure which option you are using.
Create Calculated Project Indicators LIGHTNING WEB COMPONENT
Calculated Indicators are only available as a LWC from Kalausi (v1.34) or later. If your organization is using the Visualforce ManageIndicators page, the interface will be slightly different. The logic for setting up Calculated Indicators is still the same. Reach out to your System Administrator if you have questions about creating Aggregated Indicators.
Calculated Project Indicators can be set up for any numeric Project Indicator. This feature enables organizations to perform the following functions:
Add
Subtract
MultiplyÂ
Divide
Custom formula using any of the operators above and numerical values
In the example below, the Calculated Project Indicator → Cost per solar lamp installation is created using a formula with source Project Indicators -> “Cost of solar lamp installations / Number of solar lamps”.
Since the Calculated Project Indicator requires two or more source Project Indicators to perform the calculation, the first step is to set up these indicators.
Create Source Project Indicators
Here are the steps to create Project Indicators.
When creating source Project Indicators ensure that they:
have the same reporting frequency,
have the same geographic level, and
have the same level of disaggregation as the intended Calculated Indicator.
Create a Calculated Project Indicator
Navigate to the Manage Indicators page and click on the “Add New Custom Indicator” button.
For the “Data Type” field select from Number, Currency, or Percent. Select “Calculated” for the Type of Results field and fill out other required information to create a new Project Indicator.
If the Data Type is Milestone, Qualitative or Picklist, you will receive an error message. This error message is controlled via <Link to page in technical enablement>.
On clicking “Save and Next”, the Calculation Formula popup will appear where user can create the formula used to calculate results for this Project Indicator.
Create the Calculation Formula
Once the Calculation Formula popup opens, the user can either create a formula immediately or select “Cancel”. Selecting “Cancel” will save the Project Indicator with no calculation formula, allowing the user to return and set the formula at a later time.
In the Calculation Formula popup, use the “Select Indicator” picklist to select the first source Project Indicator. Only active Project Indicators with the same geographic level, reporting frequency and disaggregation level are shown in the picklist.
Use the Select an Operation picklist to select the desired operation.
When creating a calculated Project Indicator that involves division in the formula, ensure that the “Number of Decimal Points Allowed” field for that Project Indicator has been set to either 1 or 2.
Continue navigating between the dropdown and select additional Project Indicators or operators as needed. Users can also enter numerical values from their keyboards to create more complex formulas as well.
Alphabets and other special characters (#, & etc) typed on the keyboard WILL NOT be displayed on the calculation formula popup.
Only numbers and the 3 mathematical operators (+,-,*) are allowed as input.
The “/” operator can only be selected via the picklist since it is a Salesforce keyboard shortcut to search.
An incomplete formula - for example, “Number of lamps +” will not be saved. If the user tries to save an incomplete formula, an error message will appear in response to the formula that is not mathematically possible. We recommend avoiding illogical formulas to ensure accurate results.
After clicking “Save and Exit” popup, a banner will display and confirm the successful creation of the calculated indicator. The new Project Indicator will appear in the “Selected Indicators” table on the Manage Indicators page. If a user clicks on the “X” in the right-hand corner of the popup, or selects “Cancel”, before saving then the popup will close and the indicator will save with no formula entered.Â
Manage Calculated Indicators LIGHTNING WEB COMPONENT
Edit Existing Calculated Indicators
Click on the “Edit” option in the dropdown located next to the particular Project Indicator in the “Selected Indicators” table.Â
In the popup, edit the field you want to, (example: Guideline)
We do not recommend editing the following fields once Results have been created for a particular indicator since it might lead to data inconsistencies.
Disaggregation by group
Disaggregation by sex
We recommend deactivating the indicator and creating a new Project Indicator if these fields need to be edited once result records have been created.
In order to edit the Calculation Formula, click on “Save and Edit Calculation”
This will open the “Customize Calculation” popup where the source indicators or operators can be edited.
<Confirm with PG Should we put a note about not editing calculation formula after result records have been generated to avoid data inconsistencies?>Once a Project Indicator is deactivated, it cannot be used in the formula for a calculated Project Indicator. The calculation formula popup will not display the deactivated source Project Indicator when the user clicks into the search bar to create the formula. If the user types a deactivated Project Indicator in the search bar, the message “No matching records found” will display in the dropdown.Â
Additionally, if a calculated Project Indicator uses an source indicator in its formula and the source indicator is later deactivated or deleted, then the user would be notified that the formula contains a deactivated or deleted Project Indicator through a toast message.
<Add image>
Update Calculated Indicator Results
Once the Calculated Indicators are set up, users can choose to run the query and update the indicator results. This can be done in a couple of ways:
For a single Calculated Indicator;
For all Calculated and Aggregated Indicators on the Manage Indicators page;
For all Calculated and Aggregated Indicators on the Add Results page;
For Calculated Indicators dependent on other Calculated Indicator(s).
Before starting, please ensure the following:
The relevant system permissions must be assigned to the user attempting to run the query.
A logical calculation formula has been entered for every Calculated Indicator.
Results for source Project Indicators have been entered/calculated. <add link for to add results?>
Calculate Results for a Single Calculated Indicator
Click on the “Update Results” option in the dropdown located next to the particular Project Indicator in the Selected Indicators table. Note that this option will only be shown if the Project Indicator is calculated or aggregated.
A popup will open displaying the date and time of any previously run calculation. It is displayed in the user’s locale. If no calculations have been run previously, then the date and time field will be blank.Â
Click on “Update Result” to calculate the result(s) for the Project Indicator.
While the result(s) are being updated, users cannot edit, delete or deactivate the calculated Project Indicator. The following buttons are greyed out on the Manage Indicator page:
The dropdown menu button next to the calculated indicator
“Update Results” button
It is also recommended to refrain from using the “Update Results” or “Submit Results” button on the Add Results while the results are being updated.
Once the results are updated:
The buttons will display again
The result(s) will be populated for the corresponding calculated Project Indicator on the Add Results page. Refresh the Add Results page to see the most accurate results. The last calculation date field will also be updated.
Calculate Results for All Calculated Indicators Â
The previous section describes how to calculate results for a single calculated indicator in a project. Users can also calculate results for all calculated indicators in a project.
Note that this option will calculate results for all calculated and aggregated indicators. If there are no aggregated indicators in the project, then only the results of calculated indicators will be updated.
Click on the Update Results button to run a batch update for all calculated indicators, as shown in the screenshot below.Â
Note, this button will not display if there are no aggregated or calculated indicators in the Selected Indicators table.
A pop-up will display to confirm the batch. Click “Confirm” to run the batch
On confirmation, the batch runs for all aggregated and calculated indicators in the project.
While the batch is processing, users cannot edit or delete the calculated and aggregated Project Indicators. The following buttons are greyed out:
The dropdown menu buttons next to all calculated and aggregated indicator(s)
“Update Results” button on the Manage Indicator page.
It is also recommended to refrain from using the “Update Results” button on the Add Results while the results are being updated. Users may navigate away from the screen until the batch completes.
The user is notified via email when the batch is complete and results are updated.
When batch is complete, the:
The buttons will display again and
The results for the corresponding calculated and aggregated Project Indicator(s) will be populated on the Add Results page. Refresh the Add Results page to see the most accurate results. The last calculation date field will also be updated.
Refreshing results for calculated Project Indicators where the formula contains a deactivated Project Indicator produces inaccurate Result records as the deactivated Project Indicator may contain outdated values.
Refreshing results for calculated Project Indicators where the formula contains a deleted Project Indicator does not successfully run a batch, and no new Result records are created or updated.
To ensure the calculation runs successfully, ensure that all Project Indicators referenced in the calculated Project Indicators’ formula are active.
Similarly, results can also be calculated on the Add Results page:
<Add link to Add Results page>
Calculating Results for Calculated Indicators Dependent on other Calculated Indicator(s)
Calculated indicators that are run en masse do not update in any particular order. If a calculated indicator includes one or more calculated indicators in its formula, users will need to perform one of the two actions below:
Option One: Run the batch en masse twice by clicking Refresh Indicators twice. After the second run of the batch, results will be displayed for all calculated indicators.Â
Option Two: Run the batch individually for each calculated indicator based on the hierarchy established by the formula.Â
For example: if calculating “% of households with access to clean water” and the formula includes a calculated indicator “# of households” which adds rural and urban households, then be sure to first run the calculation for “# of households”, and then after the first batch, refresh the Add Results page and run the calculation for “% of households with access to clean water indicator”.
Create & Manage Calculated Indicators VISUALFORCE PAGE
View Results on the AddResults page
Explain that the batch has been run, users can navigate to the AddResults page to see results.
In the AddResults table, each Project Indicator has an Info icon. On hover, users may view information such as Guideline and Objective(s). By customizing the popover with additional fields, user may also view:
Type_of_Results__c
Last_Calculation_Date__c
Calculation_Formula__c
<add image>
Add all limitations
Before running the calculation, navigate to the Add Results page to enter result values for the two source Project Indicators, if they have not been previously entered.Â
Navigate back to the
Manage Indicators page to run the calculation. Click the Refresh icon and confirm. 8. Navigate back to the Add Results page to see the result.Â
Â