Skip to main content
For a conceptual overview of data versioning, branches, and epochs, see How Atoti manages data versioning on Atoti Hub.
This page documents cube versions and the Epoch Dimension. For epochs, epoch management, and branches in the Atoti Datastore, see Data versioning.

What are versions?

Every committed transaction implies a new version of the Datastore. However, for each epoch, depending on the nature of the transaction, other multi-versioned components may or may not hold a version associated to this epoch.

Example

Consider the following example: within the Datastore, there are two stores, the Risk store and the Forex store. No data from the Forex Store is ever used within the Cube. The Forex Store exists purely to provide parameters for post-processing. It does not contribute to any pivot tables. The Risk Store is the base store within the Datastore and there are no references between the Risk Store and the Forex store. When a transaction commits in the Forex Store, no new IActivePivotVersion will be created, because the cube is not directly affected by anything in the Forex store. So a new version of the Datastore will be created (with an incremented Epoch Counter as its Id), but NOT a new IActivePivotVersion. The IActivePivotVersion is associated with an Epoch, but not necessarily the same one as the latest version of the Datastore. The Epoch of any version can be found by using the getEpoch() method of the IVersion interface.
Note about IActivePivotVersions: each time an IActivePivotVersion is created, a new instance of the Aggregates Cache and Post-processors defined in the cube are associated with the new version.
The illustration below shows transactions committing on either the Risk Store or the Forex store for the presented example:
Transactions

What is the Epoch Dimension?

The Epoch Dimension retrieves values from previous versions of the cube and enables indicators based on time or branch comparisons. Cross-epoch and cross-branch analysis in MDX queries is performed through the Epoch Dimension.
The Epoch Dimension can only be used in MDX queries but NOT inside post processors. The MDX function Aggregate cannot be used on the members of the Epoch Dimension.
The Epoch Dimension is by default composed of a hierarchy named after the dimension, with two levels Branch and Epoch:
The Branch level is populated by branches on which a transaction was committed.

How is the Epoch Dimension configured?

In the cube description, the following line must be entered directly after the other dimensions:
By default, the Epoch Dimension will create a dimension with a single Branch level available on the Epoch hierarchy. The above call returns a builder that allows further customization of the Epoch Dimension and its two levels: Branch and Epoch:
Note that the Epoch Dimension must be defined entirely in one call of the builder, or an error message will be prompted.

How is the Epoch Dimension disabled for specific users?

It is possible to restrict the usage of the Epoch Dimension. The dimension can be disabled for some users while the dimension is enabled for others by attaching an MdxContext to their roles, using the following method:

How do real-time What-If queries behave?

A real-time query including the Epoch Dimension such as:
respects the following contract regarding updates on the Epoch Dimension:
  • On first registration (i.e. activating real-time), all visible branches should be in the result
  • Upon creating a branch without changes, the query won’t reflect the newly created branch (No transaction on the branch means no update)
  • A commit on any visible branch will update the query and reflect the new branch

How to manage the Epoch Dimension

  • Calculated members which use the Epoch Dimension can be defined:
The previous snippet defines a Calculated Member corresponding to the rolling average of the pnl.SUM aggregated measure, with a centered 10 epoch-wide window:
PNL Sum Lisse
  • The members that are available in the dimension depend on the Epoch Management Policy. The released epochs are not available in the dimension.
  • The name of the Epoch Dimension can be changed to “Branch” (useful if the epoch level is disabled) by setting the following property:
This affects the final MDX sent to the server. To change the name of this hierarchy and its levels to match domain-specific names, use the Internationalization feature.

Efficient queries and Examples

How are efficient queries structured?

The filters on the Epoch Dimension must be performed inside sub-selects. The 2 following queries will return the same results (i.e. the values of pnl.SUM for 5 epochs): Inefficient Query:
Efficient Query:
The MDX engine evaluates the cells before building the axes. Because of this behavior, the MDX engine will, for the first query, retrieve the values of pnl.SUM on all the available versions of the cube and then only display 5 of them. The second query creates a restriction on the Epoch Dimension due to a sub-select. As the sub-selects are computed before the cells of the pivot table, the MDX engine will only retrieve the values of pnl.SUM for the 5 selected epochs.

How do queries behave with real-time updates?

With the Epoch Dimension, it is possible to look into past data. Some queries receive real-time updates if the AllMember member is not filtered out by the sub-select filtering the Epochs. Here are some examples:
The following query will receive real time updates.
One new row will appear for each new version:
SELECT [Measures].[pnl.SUM] ON COLUMNS,
[Epoch].[Epoch].[Epoch].Members ON ROWS
FROM cube
As this query aims to display the value of Epoch 20 from the branch master,
this query will not receive real time updates.
SELECT [Measures].[pnl.SUM] ON COLUMNS,
[Epoch].[Epoch].[Epoch].Members ON ROWS
FROM (SELECT [Epoch].[Epoch].[Branch].[master].[20] ON 0
FROM cube
This query is like the previous one but uses a subselect to choose 2 epochs.
SELECT [Measures].[pnl.SUM] ON COLUMNS,
[Epoch].[Epoch].[Epoch].Members ON ROWS
FROM (SELECT {[Epoch].[Epoch].[Epoch].[10],
[Epoch].[Epoch].[Epoch].[12]} ON 0
FROM cube)
This query that displays the five oldest epochs will never be updated because the MDX engine cannot register continuous queries on past Epochs.
SELECT [Measures].[pnl.SUM] ON COLUMNS,
[Epoch].[Epoch].[Epoch].Members ON ROWS
FROM (SELECT Tail([Epoch].[Epoch].[Epoch].Members, 5) ON 0
FROM cube)
This query will always display the five most recent epochs.
SELECT [Measures].[pnl.SUM] ON COLUMNS,
[Epoch].[Epoch].[Epoch].Members ON ROWS
FROM ( SELECT Head([Epoch].[Epoch].[Epoch].Members, 5) ON 0
FROM cube)

How is the Epoch Dimension used in a distributed environment?

In a distributed environment, the Query Cube does not have an Epoch Dimension by default. In order to support the Epoch Dimension in a query node, it must be specified when building the cube definition. To learn more about what-if in a distributed environment, see What-if.