Introduction to Calculations
Here are the basic terms and concepts used when working with Calculation Groups.
Calculations as Dimension Members
When defining calculations as Dimension Members, you specify which calculations to add to a Dimension. These calculations are similar to calculated metric expressions - they pre-set the MDX functions, Hierarchy and Level references as well as period function arguments.
CurrentMember Support for Metrics
When defining Calculated Dimension Members, you do not create calculated metric expressions that are tightly coupled to a single metric. Instead, their query will select Dimensions, a set of metrics, and one or more Calculated Dimension Member Attributes. The [Measures].currentMember
capability allows the AtScale engine to execute the dimension member calculation over the set of metrics selected in the query.
Calculated Dimension Attribute (Calculation Group)
Calculated Dimension Members are exposed to the BI tool as standard Dimensional Attribute, similar to AtScale's Secondary Attributes. Each member of the Calculated Dimensional Attribute is a calculation expression. You can add expressions to a Dimension when designing a model.
Calculated Dimension Members (Calculations)
The members of a Calculated Dimension Attribute are calculations with Name and Member key values similar to secondary attribute dimension members.
MDX syntax
Calculated Dimension Attributes are referenced in queries as using the same naming conventions established for dimension attributes: [DimName].[CalculationGroupName].[CalculationGroupName].[CalculationName].
For example:
- Name-based syntax for 1 Year Over Year:
[DateCustom].[Calculation Group].[Calculation Group].[YOY1]
- Key-based syntax for 1 Year Over Year:
[DateCustom].[Calculation Group].[Calculation Group].&[YOY1]
Query behavior
The execution of the Calculated Dimension Member behaves in the same way as if the calculation were a calculated metric for a given dimension and metric tuple. Therefore, standard multidimensional queries work, including those that cross by Secondary Attributes and LevelAliases. Additionally, other query features such as Unrelated Dimension Handling and Custom Empty Members behave in the same way as the equivalent calculated metric query.
Queries containing multiple calculation groups
AtScale supports queries containing multiple calculation groups, enabling you to evaluate metrics using calculations from more than one group. This gives BI tool users the flexibility to combine multiple calculations at runtime, without requiring model designers to create every necessary calculation combination in advance. Overall, this can help reduce the number of calculations in your models.
When a metric is evaluated by multiple calculation groups, the groups are evaluated in descending order according to their precedence (defined by the Precedence field of the Calculation Group properties panel). If no precedence value is specified for a group, it defaults to the value of the query.calculationGroups.defaultPrecedence
global setting; for more information, see Query Settings.