Since Cognos TM1 uses a very efficient data compression algorithm to allow large datasets to fit in relatively small amounts of RAM, TM1 calculates the values *only* when needed by TM1—resulting in improved performance and reduced storage requirements.

Here is the sequence of events:

- A value is requested from (a location in) a cube.
- TM1 Server checks if the location corresponds to the area definition of any calculation statements associated with the cube.
- If the location does correspond to a statement, TM1 evaluates the formula portion of the calculation statement.
- TM1 returns the calculated value to the relevant area.

It is important to know:

- Values are calculated only once for a cell
- Rules are executed with order preference and the first rule that gets applied to the cell, wins

Like consolidations within dimensions, TM1 rules are calculated on demand. But unlike consolidations, TM1’s sparse consolidation algorithm is not able to determine in advance which results will be empty without additional information. In fact, when consolidation occurs in TM1 cubes that have rules defined, the sparse consolidation algorithm is turned off. This is done to avoid incorrect results getting generated by the TM1 Rules. So when the sparse consolidation algorithm is turned off, every single cell in the cube is checked for a value during a consolidation and this can slow down cubes that are very large or sparse.

General rules of **thumb**:

- Remember that, if most values in your cube are zeros, this is an indication that the cube is relatively sparse.
- Multidimensional cubes are almost always sparse.
- The more dimensions a cube has, the greater is the degree of sparsity.
- In TM1, there is a distinction between a zero and a value that is missing (or non-applicable).
- In TM1, values can only be real numbers, and the value zero is used to represent zero, no (or missing) value, and even the non-applicable values.
- The impact of sparsity on calculations can be tremendous.

**Sparsity**

During consolidations, TM1 uses a sparse consolidation algorithm to skip over cells that contain zero or are empty. This algorithm speeds up consolidation calculations in cubes that are highly sparse. A sparse cube is a cube in which the number of populated cells as a percentage of total cells is low (http://publib.boulder.ibm.com). Cognos TM1 provides the use of feeders to identify which cube cells need to have rules evaluated, and which can be skipped. The effective use of Cognos TM1 feeders is essential for making your rules efficient and able to avoid combinatorial explosion.

Cognos TM1 provides the use of feeders to identify which cube cells need to have rules evaluated, and which can be skipped. The effective use of Cognos TM1 feeders is essential for making your rules efficient and able to avoid combinatorial explosion.

**Combinatorial explosion!**

In mathematics, a **combinatorial explosion **describes the effect of functions that grow very rapidly as a result of combinatorial considerations.

*Wikipedia*

A simple example that illustrates the power of the sparse consolidation algorithm is to consider the consolidation value (8433) at the intersection of total regions and surfboard lengths. To calculate the total, you must add up every possible cell which might total 119. However, if you add only the cells with non-zero values, the number of components to add may drop down significantly.

**Dissection of Cognos TM1 Rules**

Cognos TM1 Rules is nothing more than calculation statements. These calculation statements define how to compute values in the cells of the cube to which the rules are assigned. Usually, every rule you create will require one or more corresponding feeders. Feeder statements, when used correctly, ensure that the correct values are calculated by your Rules and can significantly impact on the performance of your Rules. If you use feeder statements in a rule (and you should), the rule must also contain a SKIPCHECK declaration and a FEEDERS declaration. The SKIPCHECK declaration must immediately precede any calculation statements in the rule, while the FEEDERS declaration must precede the feeder statements.

**Rules – they are only “calculation statements”…**

A calculation statement consists of the following:

- Area definition
- Leaf, consolidation, or string qualifier
- Formula
- Terminator

next time, a deep dive into Cognos TM1 rules!

**Antoninus**: Are you afraid to die, Spartacus?

**Spartacus**: No more than I was to be born.

Tags: calculation statements, cognos, Cognos TM1 Rules, Combinatorial explosion, data compression, dimension, leaf, sparsity, TM1, TM1 rules, TM1 Server, Wikipedia, •Area definition

## Follow Perficient Business Intelligence