Sunday, August 01, 2004 - Posts

Subcubes and Scripts


The concept of a “subcube” exists in AS2K. It appears in the definition of a Calculated Cell. There are probably a couple dozen people who have created Calculated Cells.

In an effort to make the extremely useful functionality of Calculated Cells more widely used, AS2005 introduces the concept of a script. A script is essentially a series of Calculated Cell definitions that look like procedural instructions. So scripts use subcubes a lot.

A subcube is basically a way of specifying one or more cells in the cube. In a script, you assign a value or a formula to a subcube. If the subcube is a single cell, you assign the value or formula to that one cell--sort of like Excel. But a subcube can be a lot bigger than a single cell: one popular subcube might include one member of one dimension (for example, a single measure), and all members of all other dimensions. When you assign a formula to a large subcube, it simply means that whenever a query asks for a cell that is in that subcube, it uses that formula to calculate the value. Again, it's like Excel, except that instead of copying a formula into 4000 cells, you specify one big range (the subcube) and assign the formula once to the whole thing.