Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Attribute

Type

Usage

pre_format

TM1RuleAreaStatement

Link to associated area statement of the TM1 rule or the feeder statementstr

Whitespaces between [ and dimension/hierarchy/element indices.

post_format

str

Whitespaces between dimension/hierarchy/element indices and ].

directives_resolver

TM1DirectiveResolver

Link to directive resolver to identify all splicing directives that apply to the area statement of the TM1 rule.

orig_dim_elem_dict

Dict[str, str]

Dictionary containing list of hierarchy/element pairs indexed by dimension, relating to dimension/hierarchy/elements as defined in the rule statement.

converted_dim_elem_dict

Dict[str, str]

Dictionary containing list of hierarchy/element pairs indexed by dimension, relating to dimension/hierarchy/elements after splicing.

applied_directives

bool

Flag indicating whether the splicing directives have been applied.

calc_rule

TM1CalcRule

Link to TM1CalcRule instance owning the area statement.

The class exposes following methods:

Method

Usage

set_calc_ruleMethod returns concatenated string composed from result of convert method of associated area_statement and

Setter for calc_rule attribute.

get_dimensions

Returns list of keys from orig_dim_elem_dict, represents list of dimensions extracted from dimension/hierarchy/elements as defined in the rule statement.

get_dimensionsget_elementselements

Returns list of hierarchy/elements pairs from orig_dim_elem_dict related to supplied dimension, represents list of elements associated with supplied dimension as extracted from dimension/hierarchy/elements as in the rule statement

add_converted_dimension

Constructs converted_dim_elem_dict by either adding or merging new elements into the dictionary. The method is called from TM1DirectiveResolver during application of directives to the rule statement in method apply_directives.

apply_directives

The method will call apply_directives of associated directives_resolver object If directives haven't been applied.

convert

This method constructs and returns entire area statement after the directives have been applied by using converted_dim_elem_dict.