Pages

Cognos TM1 Dimension Information Rules Functions

Dimension Information Rules Functions:
  • ATTRN
  • ATTRS
  • ConsolidateChildren
  • DIMNM
  • DIMSIZ
  • DNEXT
  • DNLEV
  • TABDIM
ATTRN:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
ATTRN returns a numeric attribute for a specified element of a dimension.
Syntax:
ATTRN(dimension, element, attribute)

Arguments:
ArgumentDescription
dimensionA valid dimension name.
elementAn element of the dimension.
attributeThe attribute for which you want to retrieve a value. This argument must be a valid attribute of the element.

Example:
ATTRN('Model', 'L Series 1.8L Sedan', 'Manufacture Code')
In this example, the function returns the numeric value of the Manufacture Code attribute of the L Series 1.8L Sedan element in the Model dimension.

ATTRS:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
ATTRS returns a string attribute for a specified element of a dimension.
Syntax:
ATTRS(dimension, element, attribute)

Arguments:
ArgumentDescription
dimensionA valid dimension name.
elementAn element of the dimension.
attributeThe attribute for which you want to retrieve a value. This argument must be a valid attribute of the element.

Example:
ATTRS('Model', 'L Series 1.8L Sedan', 'Manufacture Code')
In this example, the function returns the string value of the Manufacture Code attribute of the L Series 1.8L Sedan element in the Model dimension.

ConsolidateChildren:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
This function forces consolidated values to be calculated by summing immediate children along a specified dimension. This is useful when intermediate consolidations are calculated by rules and you want a parent consolidation to be calculated by summing the intermediate consolidations rather than by summing the underlying leaf values.

Syntax:
ConsolidateChildren(DimName1, DimName2, ...)

Arguments:
ArgumentDescription
DimName1, DimName2, ...Names of the dimensions along which consolidations will be performed.
The function requires at least one DimName argument, and can accept as many DimName arguments as there are dimensions in the cube for which the rule is written.
Example:
Consider a cube named Sales composed of the dimensions ActVsBud, Region, Model, Account1, and Month.
In this example, the Month dimension is defined as follows: If no rule is in place for this cube, the value of the Year consolidation is calculated by summing all the underlying leaf values, in this case Jan through Dec.
The following figure illustrates this consolidation. Now, suppose you create the following rule for this cube, which indicates that all quarterly values should be 1:
[{'1 Quarter', '2 Quarter', '3 Quarter', '4 Quarter'}]=1;
The result is as follows: In the figure, you can see that quarterly values are indeed calculated by the rule, but the Year consolidation is still calculated by summing all underlying leaf values. If this is not your desired calculation path, you can use the ConsolidateChildren function to force TM1 to calculate the Year consolidation by summing its immediate children, specifically 1 Quarter, 2 Quarter, 3 Quarter, and 4 Quarter.
['Year']=ConsolidateChildren('Month');[{'1 Quarter', '2 Quarter', '3 Quarter', '4 Quarter'}]=1;
In the rule, the statement ['Year']=ConsolidateChildren('Month') says that the Year consolidation should be calculated by summing the immediate children of Year in the Month dimension.
The following figure shows the result of the ['Year']=ConsolidateChildren('Month') statement: Note that the Year consolidation is now calculated by summing its immediate children.
It's important to remember that for a given consolidation, the ConsolidateChildren function applies only to the immediate children of the consolidation.
The ConsolidateChildren function can also be used to specify how consolidations are calculated in multiple dimensions, as in the following example:

Arguments:
ArgumentDescription
['World','Year']= ConsolidateChildren(' Region','Month')This statement applies the ConsolidateChildren function to both the World and Year consolidations. In this case, World is calculated by summing all its immediate children in the Region dimension, while Year is calculated by summing its immediate children in the Month dimension.
DIMNM:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes. DIMNM returns the element of a dimension that corresponds to the index argument.
Syntax:
DIMNM(dimension, index)

Arguments:
ArgumentDescription
dimensionA valid dimension name.
indexA value less than or equal to the number of elements in the dimension.
If this argument is less than 1, or greater than the number of elements in the dimension, the function returns 0.

Example:
DIMNM('Region',2)
This example returns 'Belgium', which is the element within the Region dimension with an index value of 2.

DIMSIZ:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
DIMSIZ returns the number of elements within a specified dimension.
Syntax:
DIMSIZ(dimension)
Arguments:
ArgumentDescription
dimensionA valid dimension name.

Example:
DIMSIZ('Accounts')
If the dimension Accounts contains 19 elements, the example returns the value 19.

DNEXT:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes. DNEXT returns the element name that follows the element specified as an argument to the function.
Syntax:
DNEXT(dimension, element)

Arguments:
ArgumentDescription
dimensionA valid dimension name.
elementThe name of an element within the dimension. This argument can also be the name of an alias for a dimension element.

Example:
DNEXT("Location","Oregon")
If the Location dimension contains the ordered elements California, Oregon, and Washington, the example returns Washington.

DNLEV:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
DNLEV returns the number levels in a dimension.
Syntax:
DNLEV(dimension)

Arguments:
ArgumentDescription
dimensionA valid dimension name.

Example:
DNLEV('Region')
In the Region dimension, the various countries (Level 0) add up to regions (Level 1). The regions then add up to super-regions (Level 2), which in turn add up to the world (Level 3).
There are four levels in the Region dimension, so the example returns the value 4.

TABDIM:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
TABDIM returns the dimension name that corresponds to the index argument.
Syntax:
TABDIM(cube, index)

Arguments:
ArgumentDescription
cubeA valid cube name.
indexA positive value less than or equal to the total number of dimensions in the cube.

Example:
TABDIM('SalesCube',3)
The cube SalesCube contains five dimensions: account1, actvsbud, model, month, and region. The example returns model, the third dimension of SalesCube.

0 comments:

© 2010 Datawarehousing Support | Home | Disclaimer | Privacy Policy