RuleLoadFromFile

RuleLoadFromFile creates a TM1® rule for a specified cube from a text file. Each rule statement must end with a semi-colon (;) and comments must be prefixed with the # character. If a rule already exists for the specified cube, the rule is overwritten by the rule created by RuleLoadFromFile.

This function is valid in TM1 TurboIntegrator processes only.

Syntax

RuleLoadFromFile(Cube, TextFile);

Argument

Description

Cube

The name of the cube for which you want to create a rule.

TextFile

The name of the text file from which you want to create a rule.

You can specify the full path to this file, including file name and extension. (Refer to Example 1.)

If you specify only the file name and extension, TurboIntegrator looks for the file in the server's data directory.

If you do not specify a file extension, TurboIntegrator assumes the .rux extension by default. (Refer to Example 2.)

If you leave the TextFile argument empty, TurboIntegrator looks for a source file with the same name as the cube (but with a .rux extension) in the server's data directory. (Refer to Example 3.)

Example 1:

The following example uses the contents of the cuberule.txt file in the C:\temp directory to create a rule for the Sales cube:

RuleLoadFromFile('Sales', 'C:\temp\cuberule.txt');

Example 2:

This example creates a rule for the Sales cube using the file named cuberule.rux in the server's data directory:

RuleLoadFromFile('Sales', 'cuberule');

Example 3:

This example creates a rule for the Sales cube using the file named Sales.rux in the server's data directory:

RuleLoadFromFile('Sales', ' ');