Expressions: Derived Cube - CubeCell

This function returns a single value from a single cell in the Cube. There are many ways to use this function, for example to return the value in the current cell, a fixed cell, a total cell, or a relative cell from one dimension, as well as multiple dimensions at the same time.

In the above example, the CubeCell function is used to create a measure in which the result is the count of the previous cell for the Region dimension.

Other options include:

CubeCell([cube$0], “MEASURE”) - DOUBLE

  • returns the value on the current cell

CubeCell([cube$0], “MEASURE”, “cell.dimension) - DOUBLE

  • returns the value from one of the cells on the given dimension

CubeCell([cube$0], “MEASURE”, “cell.dimension”, “cell.dimension”, …) - DOUBLE

  • this returns the value from a cell from somewhere else in the cube

Note

• “measure” is the name of the measure, or the numerical position of the measure in the list

• “cell.dimension” is the terminology used to establish a particular cell on a particular dimension

• “dimension” is the name of the particular dimension

• The ‘cell’ will take one of the following values:

Dimension co-ordinates are 1-based and passed as strings

x = category x (absolute reference)

0 = marginal total

+x = current category +x (relative to reference offset cell)

-x = current category -x (relative reference to offset cell)

+0 = current category (relative reference to this cell)

Note that any dimensions not named are assumed to be the current cell on that dimension.

It is also possible to use this function by not naming the dimensions, meaning that only the ‘cell’ part is used. Add a second dimension onto your Cube - for example a Cube of Region and Gender:

The cells are referenced to dimensions in the order in which they appear in the Cube – with vertical dimensions first and then horizontal ones. If you change the Cube dimensions and rebuild, the results reflect the new dimensions. Whilst the naming strategy approach is most common, the positional approach can be useful when creating Cube templates.

 

Click to return to Expressions: Derived Cube