Calculations
Calculations are important to solving problems and making decisions. They can help you define the relationships between items of interest. For example, calculations such as variance and variance percentage can assist with your cost-benefit analysis in IBM® Cognos® Insight by enabling you to compare costs versus revenues and actual sales versus projected sales.
Dimension calculations
Dimension calculations are performed from a row or column in a crosstab. For example, your crosstab shows profits and losses for each year from 2008 to 2014. You add a new column and use it to show the calculation of profits minus losses in each year.
Note the following considerations when you write dimension calculations:
- If you are using a number that is greater than zero but less than one, preface the number with a leading zero. For example, 0.10.
- Use single quotes and square brackets around names. For example, ['item_name'].
- End each calculation with a semicolon (;).
- You can use spaces to improve clarity.
- You can use both uppercase and lowercase letters. The syntax is not case-sensitive.
- Rules Functions
- TM1 TurboIntegrator Functions
Cube calculations
Unlike dimension calculations, cube calculations are a way of simplifying the creation of rules to complete common modeling operations, such as managing and maintaining the model. You can add a calculation to make your model meaningful by deriving more information from the data source.If you must create calculations that do not involve aggregating, such as calculating exchange rates or revenue, you can build formula expressions in the calculation editor. You can use functions that apply to both dimensions and cubes.
By using the calculation editor, you can view what calculations are applied to a selected cell and modify the precedence of the calculations or rules on the cube. You can use the rule editor to change the order of the rule block that is associated with the cube calculation.
Following are some of the benefits of building cube calculations:
- Obtain data from other cubes to build the calculation expression.
For example, you can use attributes that exist in a dimension other than the one where the calculation is defined.
- Apply calculations to the leaf of consolidated levels.
- Apply calculations to string elements.
- Reference element attributes.
- Use standard IBM Cognos TM1 functions for the leaf level and the consolidated level
The scope of the calculation is inferred from the selection in the cube or cube view. When you create a calculation, only the row and column dimensions are included. The calculation applies to all members on any context dimensions. If all the members of either the row or column dimension are selected, the calculation applies to all the members of the dimension. The dimension is not included in the default calculation name or the context.
The modeler can change the scope of the selection by adding, removing, and changing member selections for a dimension in one of the following ways:
- Use the dimension context area in the calculation editor.
- Add or remove the dimensions by dragging them to or from the context area of the parent cube.
Data and cube calculations maintain their integrity even when you add or remove a dimension from the cube in which you are creating calculations. However, you must ensure that you adjust links to the new dimension, if one was added. This retention is useful when you are prototyping and restructuring your cubes to adjust to the new business requirements.