Functions and formulas
Of the OLAP functions, these are list functions, which can be used in server and relational lists, and in slices:
- GETKEYS
- GETKEYSA
- GETKEYVALUESA
- GETPROPERTIESA
- GETPROPERTY
- GETPROPERTYVALUES
- GETPROPERTYVALUESA
All examples reference either the Analysis or Sales cube of the database of the Samples application. Samples can be enabled only in on-premises environments. For your reference if you do not have access to Samples, "Structure of the Samples database" gives an overview of the structure.
Example of the structure of an OLAP formula
=ROC
. A read write cell (RWC) formula begins =RWC
. =ROC("data connection","cube","[CHANNEL].[All Channels].[Direct Sales]","[MEASURE].[Gross Margin]"
,"[POS].[All POS]",B6,"[REGION].[All Regions].[Europe]",C5,"[VALTYPE].[Variance].[Actual]")
The formula defines a slice of data. The definition is enclosed in parentheses. The arguments of the formula are separated by a list separator. The arguments include the unique names of the dimension elements. These are in square brackets, separated by periods. In this example, the cell references, B6 and C5, are the key output cells of two hyperblocks.
The list separator depends on the regional settings of the operating system (by default, this is ","
).
Data ranges in formulas
An OLAP formula comprises references to a data connection, cube and dimension elements.
You can edit an OLAP formula to calculate the sum of a range of elements. To do this, separate the elements in the range with two colons (::)
.
This example calculates the sum of the values for 2006 to 2010.
=ROC("BestPracticesOLAP","SALES","[PROFIT].[Gross Margin]",
"[TIME].[All Years].[2006]::[TIME].[All Years].[2010]","[VERSION].[Actual]",
"[CURRTYPE].[LC]","[LEVEL].[IFRS]","[UNIT].[G0000]","[INTERCO].[TotalPartner]",
"[PRODUCT].[All Tires]")