mstrio > modeling > metric > dimensionality

class mstrio.modeling.metric.dimensionality.Dimensionality(dimensionality_units=None, exclude_attribute=None, allow_adding_unit=None, prompt=None)

Bases: Dictable

Object that specifies the dimensionality.

This class can only be used for simple metrics. For creation and altering of compound metrics, dimensionality needs to be defined through the use of the Expression class.

Parameters:
dimtyUnits

The list of dimty unit

excludeAttribute

boolean whether to exclude attribute absent in report or level(dimensionality)

allowAddingUnit

boolean whether to allow other users to add extra units

prompt

reference to a prompt

Type:

SchemaObjectReference | None

classmethod bulk_from_dict(source_list, connection=None, to_snake_case=True, with_missing_value=False)

Creates multiple objects from a list of dictionaries. For each dictionary provided the keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in the object’s _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of the objects that should be created.

  • source_list (List[Dict[str, Any]]) – A list of dictionaries from which the objects will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True)

Creates an object from a dictionary. The dictionary’s keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of an object that should be created.

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

allow_adding_unit: bool | None = None
dimensionality_units: list[DimensionalityUnit] | None = None
exclude_attribute: bool | None = None
prompt: SchemaObjectReference | None = None
class mstrio.modeling.metric.dimensionality.DimensionalityUnit(dimensionality_unit_type, aggregation=None, filtering=None, group_by=None, relative_position=None, target=None, axis_collection=None)

Bases: Dictable

Object that specifies the dimensionality unit.

Parameters:
dimtyUnitType

Type of unit in dimensionality

target

target of dimensionality

Type:

SchemaObjectReference | None

aggregation

type of aggregation in dimensionality

Type:

Aggregation | None

filtering

Type of filtering applied in this dimensionality

Type:

Filtering | None

relativePosition

number showing relative position of dimensionality

in metric reports
target

Object reference to attribute or report, on which the

Type:

SchemaObjectReference | None

dimensionality will be grouped at
axisCollection

dict of numbers showing, at which axis

metric will be shown
enum Aggregation(value)

Bases: AutoName

Valid values are as follows:

NORMAL = Aggregation.NORMAL
FIRST_IN_FACT = Aggregation.FIRST_IN_FACT
LAST_IN_FACT = Aggregation.LAST_IN_FACT
FIRST_IN_RELATIONSHIP = Aggregation.FIRST_IN_RELATIONSHIP
LAST_IN_RELATIONSHIP = Aggregation.LAST_IN_RELATIONSHIP
enum DimensionalityUnitType(value)

Bases: AutoName

Valid values are as follows:

DEFAULT = DimensionalityUnitType.DEFAULT
ATTRIBUTE = DimensionalityUnitType.ATTRIBUTE
DIMENSION = DimensionalityUnitType.DIMENSION
REPORT_LEVEL = DimensionalityUnitType.REPORT_LEVEL
REPORT_BASE_LEVEL = DimensionalityUnitType.REPORT_BASE_LEVEL
ROLE = DimensionalityUnitType.ROLE
enum Filtering(value)

Bases: AutoName

Valid values are as follows:

APPLY = Filtering.APPLY
ABSOLUTE = Filtering.ABSOLUTE
IGNORE = Filtering.IGNORE
NONE = Filtering.NONE
classmethod bulk_from_dict(source_list, connection=None, to_snake_case=True, with_missing_value=False)

Creates multiple objects from a list of dictionaries. For each dictionary provided the keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in the object’s _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of the objects that should be created.

  • source_list (List[Dict[str, Any]]) – A list of dictionaries from which the objects will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source)

Creates an object from a dictionary. The dictionary’s keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of an object that should be created.

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

aggregation: Aggregation | None = None
axis_collection: dict | None = None
dimensionality_unit_type: DimensionalityUnitType
filtering: Filtering | None = None
group_by: bool | None = None
relative_position: int | None = None
target: SchemaObjectReference | None = None