Adding Calculations to Reports
You can use calculations to manipulate and extend the data displayed in your Financial Report Builder reports and statements. You can apply custom or predefined formulas to your lenses and measure columns, depending on your reporting requirements. For example, you might want to sum the value of all displayed columns in your report.
You can apply calculations to your data in the following locations in Financial Report Builder:
 The Lens Configuration tab.
 The Measure Columns tab, using the Formula Builder.
Lens Configuration Tab
You can add custom formulas to perform calculations on a lens. To do this, perform the following steps:
 From your report, click  Lens Configuration.
 Click  Add Calculation. Enter your own string value to create a formula. Calculations applied in this tab appear in rows at the bottom of your report, and are typically used to display the following:
 Totals or subtotals
 Profit calculations and percentages, such as gross profit, net profit and EBITDA.
Formula Builder
The options displayed in the Formula Builder window enable you to apply predefined formulas to your measure columns or create your own formulas.
To apply a predefined formula or create your own, perform the following steps:
 Click the row in the Measure Calculation Columns table that you want to perform a calculation on.
 In the Formula Builder window, specify the calculation you want to apply using the following options:
Calculation Type
The following predefined types of calculation are available:
 Total. Displays the total value of your selected measure.
 Measure. Enables you to create a formula based on the measure columns displayed in the Measure Columns tab.
 Rolling Total. Displays a rolling total for your selected measure.
 Percentage. Displays the value of your selected measure as a percentage.
Measure
Select the measure you want to perform the predefined calculation type on.
Value
Select a single value in your selected measure.
An example of how Calculation Type, Measure, and Value operate together is shown below.
In this example, if you select your Calculation Type as Measure, and your Measure as Sum of Dual Value, you would then be presented with the option of selecting Merlin Technologies Ltd., Merlin Technologies Pty., or Merlin Technologies, Inc., under Value.
 Click Apply to apply your selected formula. Alternatively, you can write your own formula in the Measure Calculation field.
 Click Save.
Manually Entering Formulas
You can manually enter a string to apply a formula in the Lens Configuration tab or Measure Columns tab.
Example One
A Trial Balance report uses the Financial Transactions dataset from Financial Analytics as its data source.
The selected lens for this report is Transactional Trial Balance. This lens contains General Ledger Accounts and their opening and net values for periods 002 and 003, 2021. This lens is assigned the alias TB
in our Lens Configuration tab.
You might want to add a row at the bottom of our report to show the sum of rows contained in your selected lens. To do this, click  Add Calculation and give this section the name Total
. Enter the string for our required formula: sum(TB)
. A row labelled "Total" summing all the rows in the lens is now displayed in the report.
Example Two
You might want to add a measure column displaying the closing balance for a selected period in your Trial Balance report.
To do this, you add a measure column with the name "Closing". You can then manually enter a formula or select a formula from the list of predefined options, by rightclicking your required row to open the Formula Builder. You can manually enter the string sum(measures())
in the Measure Calculation field.
Formula Syntax
The formula symbols and syntax used in columns and rows in Financial Report Builder are similar to those used by Excel.
Refer to the table below for sample basic operators and functions available for use in Financial Report Builder. For example, A*B
sums the value of the columns represented by the aliases A and B. The syntax used in each example varies according to whether it is used in a lens or measure column.
Many of these operators and functions are also used in Analytics SAQL functions. For more information, see the Salesforce Help.
Operator 
Measure Column 
Lens 
Description 

^

SUM(A)^2

Indicates an exponent used to raise the power of a number.  
&'%'

A&'%'

SUM(A)&'%'

Appends rows with a percentage symbol, for example when displaying Gross Profit or EBITDA as a percentage. 


SUM(A) * SUM(B)

Multiplication applied by row/column. 
/



Division applied by row/column. 




Subtraction applied by row/column. 
+



Addition applied by row/column. 
()

(BA)/(A*100)


Parentheses for grouping operations. 
abs()

abs(measures())

Returns the absolute number of n as a numeric value, for example, to remove the minus sign from a negative number, making it positive.  
sum()

sum(measures())

Returns the value of a numeric field  
average()

average(measures())

Returns the average of the values of a measure field.  
count()

count(measures())

Returns the sum of all nonblank values in a row.  
countblank()

countblank(measures())

Returns the sum of all blank values in a row.  
max()

max(measures())

Returns the maximum value of a measure field.  
median()

median(measures())

Returns the median value of a measure field.  
min()

min(measures())

Returns the minimum value of a measure field.  
mode()

mode(measures())

Returns the modal value of a measure field. 