Basic Concepts

OuterCube is an in memory column database. It works in the style of load once, slice and dice multiple times. In OuterCube there are 3 main concepts: context, dimension, and measure

The names used in the script to refer to these concepts are case sensitive


A context is a bitmap index, or also refereed as a compressed bit array, that contains the set of rows that meet the condition of the context. For example: Category = Diet.

Context can be accessed by the name dimension that they belong, and the name of the context itself. For example: brand.pepsi

A context can be queried if a specific row id is in it, and it will return true or false accordingly

Contexts can be combined using logical operators (and, or, not, minus) creating new contexts. You can use parenthesis to specify priority of calculation

Contexts also can aggregate a measure by using one of the aggregate functions ( sum, avg, min, max, stddev, var ). The aggregate function ‘count’ does not need a measure, and returns the number of rows in the context.

Also a context can be used with a measure to assign values only to the rows that are in the context, and 0 to the others


A dimension is a collection of Contexts. A context cannot exist outside a Dimension, by default at least it will exists in the ‘global’ dimension. A context can also belong to multiple collections.

A row in a collection might belong to multiple contexts, or in other words, the contexts in a dimension might overlap. The Dimension class has a method that test if there are overlaps between its contexts.

There are 2 dimensions that every workspace has: global and sys.

  • The ‘global’ dimension contains contexts created by the script that are loose, meaning that they do not belong to any dimension. When refereeing to contexts in the global dimension, the ‘global.’ can be omitted and the name of the context can be referenced directly
  • The ‘sys’ dimension has only 2 contexts: ‘All’ and ‘None’. The ‘All’ context is the context that contains all the rows, the ‘None’ context is the empty set of rows.

A dimension can be crossed with another dimension. This creates a new dimension that contains the cross multiplication of the contexts. This is useful, for example, to prepare for multilevel crosstabs.


A measure is a list of numeric row values. For example: Price.

Measures can be combined using math operators ( +, -, *, / ) and constant numeric values to create new measures.

A measure can be converted into a dimension by a process called ‘Binning’. By specifying a set of named ranges, or bins, a dimension can be created where each context has the name of a bin and the rows that fall within that range for the measure. These ranges are inclusive for the lower side, and exclusive from the upper side.