Create Calculated Measures for Charts
In SAP Analytics Cloud, the Calculated Measures calculation creates a new measure (or account) that you can use in your chart.
Context
Measures (which are referred to as Accounts in a planning model) are numerical values on which you can use mathematical functions. When setting up your calculation, you’ll apply the typical formula functions, conditions, and operators to the data contained in your model.
Depending on your model or data source, you may see either accounts or measures or both.
Calculated measures allow you to perform mathematical and Boolean operations on your data. For example, you can use a calculated measure to chart the effect a sales increase of 20% would have on profits.
-
Choosing a number format that uses periods (.) as decimal separators means that commas (,) must be used to separate function parameters (for example, IF(Condition, ValueIfConditionIsTrue, ValueIfConditionIsFalse)).
-
Choosing a number format that uses commas (,) as decimal separators means that semi-colons (;) must be used to separate function parameters (for example, IF(Condition; ValueIfConditionIsTrue; ValueIfConditionIsFalse)).
If the formula is typed in from scratch, the correct function auto-completion happens based on the user preferences. However, if you copy and paste a full formula string, auto-complete won't be able to adapt if there is a mismatch between separators used and the user preferences.
The following functions, conditions, and operators are available for creating calculated dimensions. For descriptions of each option, see All Formulas and Calculations.
IF() | POWER() | NOT() |
ABS() | GrandTotal() | TRIM() |
LOG() | %GrandTotal() | FINDINDEX() |
LOG10() | LENGTH() | RIGHT() |
INT() | LIKE() | LEFT() |
FLOAT() | SUBSTRING() | SPLIT() |
DOUBLE() | ISNULL() | ENDSWITH() |
The ISNULL function identifies NULL values, but won't replace a NULL value with a value.
For example, your calculated dimension has the following formula: CD1=IF(ISNULL(D1), "No Value", D1)
The value in cell D1 will not be changed to show the words “No Value”: it will stay as a NULL value.
AND | OR |
> (greater than) | < (less than) |
>= (greater than or equal) | <= (less than or equal) |
= (equal) | != (not equal) |
-
+ (addition)
-
- (subtraction)
-
* (multiplication)
-
/ (division)
In the Calculation Editor, you only see the functions that are valid for your data source.
Charts can use only one Account Hierarchy at a time. You can use different hierarchies for different charts, but if you change an account hierarchy in a chart, your data may no longer be displayed.
Procedure
Results
A measure is created based on the formula you entered, and it is displayed as a new measure or a new cross calculation dimension.
If the formula uses an input control, it will appear on the canvas.
On the canvas, input controls are indicated by the (Formula) icon. If you hover over the icon, all calculations associated with the input control are displayed. By default, the input control is displayed in token mode where input values can be selected from a drop-down list. The input control can be expanded into widget mode, where radio buttons appear beside each value.