DimCalcDefMake

The DimCalcDefMake verb creates or updates a dimension calculation definition in the model.

The user interface equivalents are the Add and Modify commands on the Calculation tab of the Dimension property sheet.

There are two parts to a dimension calculation definition in MDL: a DimCalcDefMake or DimCalcDefAdd statement defining the calculation, and a CatMake or CatAdd statement defining the category.

The link between the two is an option in the CatMake or CatAdd statement that references the DimCalcDefMake or DimCalcDefAdd statement. For more information, see DimCalcDefAdd.

Calculated categories are defined as regular categories, not special categories.

The syntax is as follows:

DimCalcDefMake objDimCalcDef  [Dimension objDim] GroupCalculateCategory {True|False}][ 
Calc expropts] [Set string StartList objCats EndList]

Argument

Description

DimCalcDefMake objDimCalcDef

Creates the dimension calculation definition objDimCalcDef or modifies it if it exists. Include the object name if the definition does not exist.

Dimension objDim

Is specified, if necessary, to uniquely identify objDimCalcDef. objDim can be the object name, object identifier, or both.

GroupCalculateCategory  {True|False}

Specifies that calculated categories be grouped together in the dimension viewer. The equivalent in the user interface is the Group Calculated Categories Together check box, which displays in the Category Calculation Definition dialog box when you create a category definition. The default is False.

Calc expropts

Specifies the calculation. expropts are a mixture of calculation keywords and objects. The calculation keywords that can be used are Average, Max, and Min, as well as the Cognos® Transformer-specific functions Change, Percent-Growth and Share. The objects are specified as object name followed by an at sign (@), the object type, and, optionally, an at sign (@) and the object identifier. The object type can be Category, Level, or Drill. For example, "Go Water Bottle@Category@4805".

Set s tring StartList objCats Endlist

Creates one or more sets and specifies the categories in each set. string is the set name, such as Set 1, Set 2, and so on. objCats can be the object name or the object identifier. This argument is repeated for each set; for example

Set "Set 1" StartList 4795 4797 EndList Set "Set 2" StartList 4799 EndList

Example

This example defines the dimension calculation Share ("Set 1", "GO Sport Line").

DimCalcDefMake 27195 'share("Set 1", "GO Sport Line")' Dimension 2947 
GroupCalculateCategory True Calc share ("Set 1@Set", "GO Sport 
Line@Category@4789") Set "Set 1" StartList 4793 4797 4801 4803 EndList