Copied to clipboard

Overview

Use this reference guide to learn about the syntax and semantics of advanced formula steps in SAP Analytics Cloud data actions. It's meant for administrators with an understanding of planning processes and models within SAP Analytics Cloud. You don't need previous scripting experience, though. Advanced formula steps use their own scripting language, which is similar to formulas in SAP Analytics Cloud models. If you write SQL script, you'll also recognize some instructions.


Introduction to Advanced Formulas

Advanced formula steps in data actions give you a lot more flexibility to run calculations on planning model data. The calculation results are stored in the base cells of the model, which means that you can run calculations and copy data across different sets of filters. Similar syntax is available when creating calculated accounts and measures, but most of that syntax is function-based. Planning with advanced formulas requires more procedural functionality, so it exists as a separate language.


Notation Convention

This reference uses syntax notation very similar to Backus-Naur Form (BNF), a notation technique used to define programming languages.


Symbols

This reference guide uses the following symbols to show the relationships between syntax terms.

Symbol Description
< > Angle brackets surround the name of a syntactic element.
::= The definition operator defines the element that appears to its left.
[] Square brackets indicate optional elements in a formula. You can choose whether to specify or omit optional elements in your script.
{} Braces group elements in a formula. Repeating elements (zero or more elements) can be specified within brace symbols.
| The alternative operator indicates that the portion of the formula following the bar is an alternative to the portion preceding it.
[...] An ellipsis with square brackets around it indicates optional repetition of the preceding element or grouped elements.
For example, if you can specify one or more columns for an option and must separate them by commas, this is expressed as: <column_name> [,...].
An example of grouped elements that don't need a comma separator looks like this: { <column_name> <data_type> } [...]

Syntax Term Representations

Throughout this reference guide, each syntax term is defined using one of the following representations:

<model> ::= "Model_Name"
<linked_model> ::= Linked<model>
<version_dim> ::= [d/Version_Dimension_Name]
<measure_dim>::= [d/Measures]
<account_dim> ::= [d/Account_Dimension_Name]
<date_dim> ::= [d/Date_Dimension_Name]
<generic_dim> ::= [d/Generic_Dimension_Name]
<organization_dim> ::= [d/Organization_Dimension_Name]
<dimension> ::= [<account_dim> | <date_dim> | <generic_dim> | <organization_dim>]
<measures/dimension> ::= [<measure_dim> | <account_dim> | <time_dim> | <generic_dim> | <organization_dim>]
<property> ::= [p/Property_ID]
<hierarchy> ::= [h/Hierarchy_ID]
<parent_member> ::= "Parent_Member_ID"
<parent_members> ::= <parent_member> [, ...]
<leaf_member> ::= "Leaf_Member_ID"
<leaf_members> ::= <leaf_member> [, ...]
<measure>::="Measure_Member"
<leaf_member/measure> ::= [<leaf_member>|<measure>]
<leaf_members/measures> ::= <leaf_member/measure> [, ...]
<date_hierarchy> ::= <date_dim>.<hierarchy>
<date_member> ::= <leaf_member> of <date_dim>
<property_value> ::= "Value" of <property>
<#variablemember> ::= #VariableMember
<@integer> ::= "INTEGER Variable"
<@float> ::= "FLOAT Variable"
<number_variable>::= {<@integer> | <@float>}
<parameter_any_leaf> ::= %Parameter% (Type: Member/Measure; Cardinality: Any; Hierarchy Level: Leaf)
<parameter_single_leaf> ::= %Parameter% (Type: Member/Measure; Cardinality: Single; Hierarchy Level: Leaf)
<parameter_single_any> ::= %Parameter% (Type: Member/Measure; Cardinality: Single; Hierarchy Level: Any)
<parameter_any_any> ::= %Parameter% (Type: Member/Measure; Cardinality: Any; Hierarchy Level: Any)
<parameter_number> ::= %Parameter% (Type: Number)

<operator> ::= + | - | / | *
<comparator> ::= != | =
<comparator_all> ::= < | > | = | <= | >= | !=
<and_or> ::= AND | OR
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<sign> ::= + | -
<period> ::= .
<unsigned_integer> ::= <digit>[...]
<signed_integer> ::= [<sign>] <unsigned_integer>
<unsigned_numeric> ::= <unsigned_integer> [ <period> [ <unsigned_integer> ] ] | <period> <unsigned_integer>
<signed_numeric> ::= [<sign>] <unsigned_numeric>
<numeric> ::= <signed_numeric> | <signed_integer>

<fixed_date> ::= YYYY-MM-DD | YYYY-MM | YYYY-Q | YYYY | YYYYMMDD | YYYYMM | YYYYQ | YYYY/MM/DD | YYYY/MM | YYYY/Q | YYYY.MM.DD | YYYY.MM | YYYY.Q