CubeRuleAppend

This function appends a single line of rule text to a TM1® cube rule.

This is a TM1 TurboIntegrator function, valid only in TurboIntegrator processes.

Essentially, this function adds a single line of text to a rule (.rux) file. The line of text is typically a rule statement, but can also be a comment. If there is no rule associated with the cube at the time this function is executed, a new rule will be created, containing only the passed line.

Syntax

CubeRuleAppend(CubeName, RuleText, IsCalculationRule);

Argument

Description

CubeName

The name of the cube associated with the rule to which you want to append a line of text.

RuleText

The single line of text you want to append to the rule.

The entire line of text you add must be enclosed in single quotes and must adhere to rules syntax conventions.

If the line of text includes any element references, the element names must be enclosed in double single quotes to escape the single quotes that normally enclose element names. For example, a reference to an element named CL3 must be specified as [''CL3''].

The following are examples of valid lines of text you might append to a rule:

'[''CL3''] = [''CL4''] + [''Trial''];'

'skipcheck;'

'[''Trial''] => [''CL3''];'

IsCalculationRule

The IsCalculationRule parameter declares whether the line should be inserted just above any feeder section that might exist in the cube rule. If the IsCalculationRule parameter is omitted, or passed as 0.0, then the new line will simply be appended to the end of the rule.

Because rule (.rux) files consist of a calculation section followed by an optional feeder section, any appended lines that are calculation rule statements (or corresponding comments) should use a 1.0 for this argument to ensure that the new line is inserted in at the appropriate location in the rule file.

Examples

CubeRuleAppend( 'MyCube', '[''CL3''] = [''CL4''] + [''Trial''];', 1.0 );

This example inserts the calculation statement ['CL3'] = ['CL4'] + ['Trial']; at the end of the calculation section of the rule for the MyCube cube.

CubeRuleAppend( 'MyCube', '[''Trial''] => [''CL3''];', 0.0 );

This example inserts the feeder statement ['Trial'] => ['CL3']; at the end of the rule for the MyCube cube.