mstrio > modeling > expression > expression_nodes¶
- class mstrio.modeling.expression.expression_nodes.AttributeFormPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, function, attribute, form, parameters=<factory>, data_locale=None)¶
Bases:
PredicateNode
Specialized expression node that contains an attribute form qualification predicate.
This qualification selects elements of a specified attribute by comparing the value of a specified form of the element with an expression. The comparison operator used is also specified. However, there are three options for specifying the expression with which it is compared:
The client may specify a literal value.
The client may ask to use a prompt to determine the value.
The client may supply an arbitrary metric style expression to evaluate to
obtain the value.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
function (Function) –
attribute (SchemaObjectReference) –
form (SchemaObjectReference) –
parameters (list[PredicateParameter]) –
data_locale (str | None) –
- function¶
Specify the comparison function that should be used to compare the value computed by the filter with an expression value.
- Type:
- parameters¶
list of objects that correspond to the parameters for the comparison function. In nearly all cases the comparison function will take one extra parameter (in addition to the parameter referenced by the predicate’s main object).
This value is a list because there are a few functions which take a different number of extra parameters. For example isNull does not need any additional parameters; notBetween needs two additional parameters.
- Type:
list[PredicateParameter]
- attribute¶
The attribute whose elements are selected by this qualification
- Type:
- form¶
The attribute form whose value is used to specify the qualification
- Type:
- data_locale¶
Optional data locale used to select values of the form. The format should follow the IETF BCP 47 language tag, for example: “en-US”.
Some forms of some attributes may be configured to store representation in multiple locales. If a predicate qualifies on a form that has been translated in this manner it is likely that the elements selected by the predicate will be different for different locales. But we do not want the meaning of a filter to vary based on the locale preferences of the user executing the filter. So this property is used to specify the data locale to be used for the qualification. When set it will override the user’s personal data locale preference.
Retrieving a filter only returns this field if the form is multilingual. If the form is multilingual but no particular locale is set, an empty string will be returned. When updating or creating a filter, again a check will be made to see if the form is capable of being multilingual. If not, users inputs are ignored. If the form is indeed multilingual and the field is omitted from the input, the locale will default to the warehouse data locale of the user.
- Type:
str | 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- attribute: SchemaObjectReference¶
- data_locale: str | None = None¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- form: SchemaObjectReference¶
- parameters: list[PredicateParameter]¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.BandingCountPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, level, metric, band_metric_function, start, stop, count, band_names=None)¶
Bases:
BandingPredicate
The Band count type of banding qualification slices a range of metric values into a number of equal bands that appear as rows on a report.
You define the range by setting the start at and stop at values. You also set the band count, which is the number of bands to use.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
level (list[SchemaObjectReference]) –
metric (SchemaObjectReference) –
band_metric_function (BandMetricFunction) –
start (Variant) –
stop (Variant) –
count (Variant) –
band_names (list[str] | None) –
- enum BandMetricFunction(value)¶
Bases:
AutoName
Enumeration constant used to specify function used to slice metric values into bands
Valid values are as follows:
- VALUE = BandMetricFunction.VALUE¶
- RANK_DESCEND = BandMetricFunction.RANK_DESCEND¶
- PERCENTILE_DESCEND = BandMetricFunction.PERCENTILE_DESCEND¶
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- band_metric_function: BandMetricFunction¶
- band_names: list[str] | None = None¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- level: list[SchemaObjectReference]¶
- metric: SchemaObjectReference¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.BandingDistinctPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, level, metric, band_metric_function)¶
Bases:
BandingPredicate
The Band for each distinct metric value type of banding qualification creates a separate band for each value calculated by the metric. The bands appear as rows on a report. This type of banding qualification directly uses the results of a metric as bands.
It is very useful with metrics that already contain the logic needed to calculate sequential band numbers. Such metrics use mathematical formulas, NTile functions, Band functions, or Case functions.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
level (list[SchemaObjectReference]) –
metric (SchemaObjectReference) –
band_metric_function (BandMetricFunction) –
- enum BandMetricFunction(value)¶
Bases:
AutoName
Enumeration constant used to specify function used to slice metric values into bands
Valid values are as follows:
- VALUE = BandMetricFunction.VALUE¶
- RANK_DESCEND = BandMetricFunction.RANK_DESCEND¶
- PERCENTILE_DESCEND = BandMetricFunction.PERCENTILE_DESCEND¶
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- band_metric_function: BandMetricFunction¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- level: list[SchemaObjectReference]¶
- metric: SchemaObjectReference¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.BandingPointsPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, level, metric, band_metric_function, points, band_names=None)¶
Bases:
BandingPredicate
The Banding points type of banding qualification slices a range of metric values into a number of bands that appear as rows on a report.
You manually define each band, which allows you to produce bands of varying sizes.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
level (list[SchemaObjectReference]) –
metric (SchemaObjectReference) –
band_metric_function (BandMetricFunction) –
points (list[float]) –
band_names (list[str] | None) –
- points¶
list of number used to slice metric values into bands
- Type:
list[float]
- enum BandMetricFunction(value)¶
Bases:
AutoName
Enumeration constant used to specify function used to slice metric values into bands
Valid values are as follows:
- VALUE = BandMetricFunction.VALUE¶
- RANK_DESCEND = BandMetricFunction.RANK_DESCEND¶
- PERCENTILE_DESCEND = BandMetricFunction.PERCENTILE_DESCEND¶
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- band_metric_function: BandMetricFunction¶
- band_names: list[str] | None = None¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- level: list[SchemaObjectReference]¶
- metric: SchemaObjectReference¶
- points: list[float]¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.BandingPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, level, metric, band_metric_function)¶
Bases:
PredicateNode
Base class for banding predicates
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
level (list[SchemaObjectReference]) –
metric (SchemaObjectReference) –
band_metric_function (BandMetricFunction) –
- level¶
level at which the computation will be performed
- Type:
list[SchemaObjectReference]
- metric¶
metric for which this banding will be applied
- Type:
- band_metric_function¶
function used to slice metric values into bands
- Type:
- band_names¶
list of band names, a band name cannot contain “#;” or “#,”
- enum BandMetricFunction(value)¶
Bases:
AutoName
Enumeration constant used to specify function used to slice metric values into bands
Valid values are as follows:
- VALUE = BandMetricFunction.VALUE¶
- RANK_DESCEND = BandMetricFunction.RANK_DESCEND¶
- PERCENTILE_DESCEND = BandMetricFunction.PERCENTILE_DESCEND¶
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- band_metric_function: BandMetricFunction¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- level: list[SchemaObjectReference]¶
- metric: SchemaObjectReference¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.BandingSizePredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, level, metric, band_metric_function, start, stop, size, band_names=None)¶
Bases:
BandingPredicate
The Band size type of banding qualification slices a range of metric values into a number of bands that appear as rows on a report.
You define the range by setting the start at and stop at values. You also set the step size, which is the size of each band.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
level (list[SchemaObjectReference]) –
metric (SchemaObjectReference) –
band_metric_function (BandMetricFunction) –
start (Variant) –
stop (Variant) –
size (Variant) –
band_names (list[str] | None) –
- enum BandMetricFunction(value)¶
Bases:
AutoName
Enumeration constant used to specify function used to slice metric values into bands
Valid values are as follows:
- VALUE = BandMetricFunction.VALUE¶
- RANK_DESCEND = BandMetricFunction.RANK_DESCEND¶
- PERCENTILE_DESCEND = BandMetricFunction.PERCENTILE_DESCEND¶
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- band_metric_function: BandMetricFunction¶
- band_names: list[str] | None = None¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- level: list[SchemaObjectReference]¶
- metric: SchemaObjectReference¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.ColumnReference(*, expression_type=None, dimty_type=None, dependence_type=None, column_name, object_id=None)¶
Bases:
ExpressionNode
n expression node whose value is some column from a table implied by the expression’s context.
This kind of node is used when we wish to define an expression over the columns of a table or potentially over more than one table. The reference specifies, the column of interest, by name alone. So the reference is to a selected column on the implied table. It is not a reference to a specific column on a specific table. Defining a column reference in this manner allows the architect to specify an expression that can be usefully applied to more than one table.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
column_name (str) –
object_id (str | None) –
- column_name¶
The name of the column, as it appears within the RDBMS.
- Type:
str
- object_id¶
A globally unique identifier used to distinguish between metadata objects within the same project. It is possible for two metadata objects in different projects to have the same Object id.
- Type:
str | 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
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) – (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
- column_name: str¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- object_id: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.Constant(*, expression_type=None, dimty_type=None, dependence_type=None, variant=None, prompt=None)¶
Bases:
ExpressionNode
An expression node that contains a literal value. The value was fixed when the expression node was first specified. This kind of node is only used for simple values (integers, floating point numbers and text strings).
Alternatively, instead of the variant the node could contain a choose-value prompt reference.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
variant (Variant | None) –
prompt (SchemaObjectReference | None) –
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
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) – (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
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- prompt: SchemaObjectReference | None = None¶
- class mstrio.modeling.expression.expression_nodes.CustomExpressionPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, expression, node_property=None)¶
Bases:
PredicateNode
Specialized expression node that contains a custom expression predicate. This qualification contains a valid expression, usually created by the user, which can’t be categorized into other types.
The expression is represented by a list of tokens. The predicate has the predicate details which contains the tokens representing the expression. It’s controlled by the showPredicates to show or hide.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
expression (Expression) –
node_property (int | None) –
- expression¶
Generic specification for calculation, instance of Expression class
- Type:
- node_property¶
A property used for persisting back-compatibility information for the filter editing. Usually it will not show.
- Type:
int | 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- dependence_type: DependenceType | None = None¶
- expression: Expression¶
- expression_type: ExpressionType | None = None¶
- node_property: int | None = None¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.DynamicDateTime(*, expression_type=None, dimty_type=None, dependence_type=None, value)¶
Bases:
ExpressionNode
An expression node that represents Dynamic Date Time.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
value (DynamicDateTimeStructure) –
- value¶
an object that represents date and/or time.
- Type:
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
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) – (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
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- value: DynamicDateTimeStructure¶
- class mstrio.modeling.expression.expression_nodes.ElementListPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, attribute=None, elements=None, elements_prompt=None, function=ElementListFunction.IN)¶
Bases:
PredicateNode
Specialized expression node that contains an element list predicate.
This qualification selects elements of a specified attribute by either listing the elements that should be selected, or alternatively by listing the elements that should be excluded from the selection.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
attribute (SchemaObjectReference | None) –
elements (list[AttributeElement] | None) –
elements_prompt (SchemaObjectReference | None) –
function (ElementListFunction) –
- attribute¶
The attribute whose elements are selected by this qualification. Property is not needed if the predicate uses a prompt since in that case the attribute is specified by the prompt.
- Type:
SchemaObjectReference | None
- elements¶
List of the elements in the predicate
- Type:
list[AttributeElement] | None
- elements_prompt¶
A choose-elements prompt used to obtain the elements in the qualification. If this object is used then it will specify the attribute and elements for the qualification. The prompt will specify an attribute from which the elements should be selected.
- Type:
SchemaObjectReference | None
- function¶
Specify the function that should be used in this predicate.
Although this property is a function identifier, there are only two functions that make sense for this predicate:
IN (the filter accepts any element in the list, default value)
NOT_IN (the filter accepts any element not included in the list)
- Type:
- enum ElementListFunction(value)¶
Bases:
AutoName
Enumeration constant that describes what functions can be used within ElementListPredicate
Valid values are as follows:
- IN = ElementListFunction.IN¶
- NOT_IN = ElementListFunction.NOT_IN¶
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- attribute: SchemaObjectReference | None = None¶
- dependence_type: DependenceType | None = None¶
- elements: list[AttributeElement] | None = None¶
- elements_prompt: SchemaObjectReference | None = None¶
- expression_type: ExpressionType | None = None¶
- function: ElementListFunction = 'in'¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.ExpressionFormShortcut(*, expression_type=None, dimty_type=None, dependence_type=None, attribute, form, data_locale=None)¶
Bases:
ExpressionNode
An expression node that represents shortcut to an expression form.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
attribute (SchemaObjectReference) –
form (SchemaObjectReference) –
data_locale (str | None) –
- attribute¶
Information about an object referenced within the specification of another object. An object reference typically contains only enough fields to uniquely identify the referenced objects.
- Type:
- form¶
Information about an object referenced within the specification of another object. An object reference typically contains only enough fields to uniquely identify the referenced objects.
- Type:
- data_locale¶
Optional data locale used to select values of the form. The format should follow the IETF BCP 47 language tag, for example: “en-US”.
Some forms of some attributes may be configured to store representation in multiple locales. If a predicate qualifies on a form that has been translated in this manner it is likely that the elements selected by the predicate will be different for different locales. But we do not want the meaning of a filter to vary based on the locale preferences of the user executing the filter. So this property is used to specify the data locale to be used for the qualification. When set it will override the user’s personal data locale preference.
- Type:
str
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
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) – (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
- attribute: SchemaObjectReference¶
- data_locale: str | None = None¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- form: SchemaObjectReference¶
- class mstrio.modeling.expression.expression_nodes.ExpressionRelationship(*, expression_type=None, dimty_type=None, dependence_type=None, level, guide=None, is_independent=IsIndependent.YES, children=None)¶
Bases:
ExpressionNode
An expression node that represents expression relationship.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
level (list[SchemaObjectReference]) –
guide (SchemaObjectReference | None) –
is_independent (IsIndependent) –
children (list[ExpressionNode] | None) –
- level¶
Within an expression we sometimes need to state at which a computation is performed. In some cases the level is obtained by examining the execution environment. This object is used if the designer wishes to specify an explicit level.
An explicit level is a list of attributes. Alternatively the client may defer selecting an attribute (or attributes) at design time by using a prompt instead. If a prompt is used it should be a choose-attributes prompt, and it may return any number of attributes (including zero).
- Type:
list[SchemaObjectReference]
- guide¶
An optional object that specifies how to relate the child filter with the output filter. There are three options, depending on the nature of the guide object:
The object may be a logicalTable, in which case the filter is
projected through this table.
The object may be a fact, in which case the filter is projected
via one of the tables on which the fact is defined.
There might not be a guide object at all, in which case the
filter is projected via the engine’s usual join rules (using attribute relationships from the system hierarchy).
- Type:
SchemaObjectReference | None
- is_independent¶
Flag that indicates whether this child filter will be considered independently of other parts of the larger filter:
If set to 1 (the default value, used if this property is omitted)
then this filter will be evaluated by itself.
If set to 0 then other parts of the larger filter will be merged
into this filter. Using this setting could change the value of a metric or relationship set qualification that appears within the child filter.
- Type:
- children¶
List containing the optional root node of the child filter expression. We require that a relationship predicate always has a child filter is always given, but it is possible that the child filter is the empty filter. We model that situation by either omitting the children value or by using an empty list.
This expression is also a filter expression, and it is manipulated in the same manner as the rest of the filter. The predicate ids that appear within this expression must have disjoint values from the predicate ids used in the larger filter. Thus, an individual node within this expression can be manipulated by treating it as a manipulation of the larger filter in the usual manner.
We use a list so that this value matches the list value of the same name used in an operator node.
- Type:
list[ExpressionNode] | 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- children: list[ExpressionNode] | None = None¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- guide: SchemaObjectReference | None = None¶
- is_independent: IsIndependent = 1¶
- level: list[SchemaObjectReference]¶
- class mstrio.modeling.expression.expression_nodes.FilterQualificationPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, filter, is_independent=IsIndependent.YES)¶
Bases:
PredicateNode
Specialized expression node that contains a filter qualification predicate.
This node is used within filter expressions to represent a predicate whose value is determined by using an external filter object. At execution time the engine will typically act as if the specified filter had been included directly. By using shared filter objects, the client can build complex filter expressions to utilise common subexpressions.
A filter object may not reference itself, or any filter that depends on itself. If such a filter is saved to the metadata any calculation that uses the filter will fail.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
filter (SchemaObjectReference) –
is_independent (IsIndependent) –
- filter¶
Reference to the child filter that should be included in this predicate.
- Type:
- is_independent¶
Flag that indicates whether this child filter will be considered independently of other parts of the larger filter:
If set to 1 (the default value, used if this property is omitted)
then this filter will be evaluated by itself.
If set to 0 then other parts of the larger filter will be merged
into this filter. Using this setting could change the value of a metric or relationship set qualification that appears within the child filter.
- Type:
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- filter: SchemaObjectReference¶
- is_independent: IsIndependent = 1¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.JointElementListPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, level, tuples)¶
Bases:
PredicateNode
Specialized expression node that contains a joint element list predicate.
This qualification represents a filter at the level of two or more attributes. The filter is defined by simply listing the tuples of elements that satisfy the filter.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
level (list[SchemaObjectReference]) –
tuples (list[list[AttributeElement]]) –
- level¶
The level of this filter represented as a list of attributes. The attributes must be different from each other, and their order is significant.
- Type:
list[SchemaObjectReference]
- tuples¶
List of tuples of elements.
Each element of this list is a joint element. That is the members of this list are themselves lists of elements. The elements in the tuples must be listed in the same order as the attributes were listed in the level list. There is no need to list the attribute on each element.
- Type:
list[list[AttributeElement]]
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- level: list[SchemaObjectReference]¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- tuples: list[list[AttributeElement]]¶
- class mstrio.modeling.expression.expression_nodes.MetricPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, function, metric, level_type, parameters=<factory>, level=None, metric_function=None, null_include=None, break_by=None, is_independent=IsIndependent.YES)¶
Bases:
PredicateNode
Specialized expression node that contains a metric qualification predicate.
This qualification selects tuples of elements at a specified level by comparing the value of a specified metric evaluated at the tuple with a value of an expression. The comparison operator used is also specified. However, there are multiple options for specifying the expression with which the metric is compared:
The client may specify a literal value.
The client may specify an object reference.
The client may ask to use a prompt to determine the value.
The client may supply an arbitrary metric style expression to evaluate to obtain the value.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
function (Function) –
metric (SchemaObjectReference) –
level_type (str) –
parameters (list[PredicateParameter]) –
level (list[SchemaObjectReference] | None) –
metric_function (MetricFunction | None) –
null_include (int | None) –
break_by (list[SchemaObjectReference] | None) –
is_independent (IsIndependent) –
- function¶
Specify the comparison function that should be used to compare the value computed by the filter with an expression value.
- Type:
- metric¶
The metric over whose values this qualification is evaluated.
- Type:
- parameters¶
List of objects that correspond to the parameters for the comparison function. In nearly all cases the comparison function will take one extra parameter (in addition to the parameter referenced by the predicate’s main object).
- Type:
list[PredicateParameter]
- level_type¶
Enumeration value indicating how the predicate’s level should be determined. If there is a level it is usually taken to be the same level as is used in the display grid, or which was used to obtain the data. There is also an option to specify an absolute level as part of the predicate definition.
- Type:
str
- level¶
Within an expression we sometimes need to state at which a computation is performed. In some cases the level is obtained by examining the execution environment. This object is used if the designer wishes to specify an explicit level. An explicit level is a list of attributes. Alternatively the client may defer selecting an attribute (or attributes) at design time by using a prompt instead. If a prompt is used it should be a choose-attributes prompt, and it may return any number of attributes (including zero).
- Type:
list[SchemaObjectReference] | None
- metric_function¶
Optional parameter that describes how the metric is used within the predicate. If this parameter is omitted it is treated as if it had been set to value.
- Type:
MetricFunction | None
- null_include¶
NullInclude is an integer parameter which specifies how null values are considered when evaluating the Rank function. Use 1 to place null values after the value list, use -1 to place null values before the value list or use 0 to apply the Null checking setting for Analytical Engine in VLDB properties. If this value is not set, 0 will be applied.
- Type:
int | None
- break_by¶
The break by property of a metric qualification allows you to choose the attribute level at which to restart counting rank or percent values for a metric. This attribute level must be higher than or equal to the level of aggregation for the metric itself. break_by is a list of distinct attribute references. The list may also contain a choose-attribute prompt instead which can be answered with zero, one or more attributes. This value is only used when the metric_function property is not set to value.
- Type:
list[SchemaObjectReference] | None
- is_independent¶
Flag that indicates whether the metric will be evaluated independently of other parts of the larger filter: - If set to 1 (the default value, also used if this property is
omitted) then this metric will be evaluated by itself.
- If set to 0 then other parts of the larger filter will be applied
when evaluating the metric.
- Type:
- enum MetricFunction(value)¶
Bases:
AutoName
Enumeration constant that describes how the metric is used within the predicate.
Valid values are as follows:
- VALUE = MetricFunction.VALUE¶
- RANK_DESCEND = MetricFunction.RANK_DESCEND¶
- RANK_ASCEND = MetricFunction.RANK_ASCEND¶
- PERCENTILE_DESCEND = MetricFunction.PERCENTILE_DESCEND¶
- PERCENTILE_ASCEND = MetricFunction.PERCENTILE_ASCEND¶
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- break_by: list[SchemaObjectReference] | None = None¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- is_independent: IsIndependent = 1¶
- level: list[SchemaObjectReference] | None = None¶
- level_type: str¶
- metric: SchemaObjectReference¶
- metric_function: MetricFunction | None = None¶
- null_include: int | None = None¶
- parameters: list[PredicateParameter]¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.ObjectReference(*, expression_type=None, dimty_type=None, dependence_type=None, target=None, is_independent=IsIndependent.YES, substitute_function_type=None)¶
Bases:
ExpressionNode
An expression node whose value is a reference to some other object in the metadata.
The meaning of the reference depends on the context. If the referenced object is an object that is based on an expression (say a filter or a metric) then it usually means we inline the expression from the object. But in other cases (say a fact) it means that on execution the object reference is replaced with a value of the fact in the context of execution.
Although unusual, it is possible that an object reference node might not refer to an object. If that happens this target property is usually omitted (but might be present but use 00000000000000000000000000000000 as its object_id).
The object could be a prompt to select the target object at runtime. Typically, it is not acceptable for the prompt to return more than one answer.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
target (SchemaObjectReference | None) –
is_independent (IsIndependent) –
substitute_function_type (SubstituteFunctionType | None) –
- target¶
object being referenced
- Type:
SchemaObjectReference | None
- is_independent¶
Flag that indicates whether this child filter will be considered independently of other parts of the larger filter:
If set to 1 (the default value, used if this property is omitted)
then this filter will be evaluated by itself.
If set to 0 then other parts of the larger filter will be merged
into this filter. Using this setting could change the value of a metric or relationship set qualification that appears within the child filter.
- Type:
- substitute_function_type¶
Specify how to merge multiple answers if the predicate’s value is obtained via a prompt. This property is only used when filter’s value is a prompt. If the end user selects multiple answers to the prompt, the platform will replace this node by a Boolean operator, used to combine the answers. This property determines which operator it uses. By default, it uses the parent Boolean operator (or AND if this predicate is the root of the filter). Set this property to override the default behavior.
- Type:
SubstituteFunctionType | None
- enum SubstituteFunctionType(value)¶
Bases:
AutoName
Enumeration constant that specify how to merge multiple answers if the predicate’s value is obtained via a prompt.
Valid values are as follows:
- AND = SubstituteFunctionType.AND¶
- OR = SubstituteFunctionType.OR¶
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
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) – (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
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- is_independent: IsIndependent = 1¶
- substitute_function_type: SubstituteFunctionType | None = None¶
- target: SchemaObjectReference | None = None¶
- class mstrio.modeling.expression.expression_nodes.Operator(*, expression_type=None, dimty_type=None, dependence_type=None, children=None, function=None, function_properties=None, function_prompt=None, level_type=None, level=None, node_property=None, custom_function=None)¶
Bases:
ExpressionNode
An expression node whose value is obtained by applying a specified function to a list of child expressions. Most internal nodes within an expression are operator nodes.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
children (list[ExpressionNode] | None) –
function (Function | None) –
function_properties (list[FunctionProperty] | None) –
function_prompt (SchemaObjectReference | None) –
level_type (LevelType | None) –
level (list[SchemaObjectReference] | None) –
node_property (int | None) –
custom_function (SchemaObjectReference | None) –
- children¶
The list of child expression that combined at this operator. If there are multiple child expressions then their order is significant. In a few cases (depending on the function) it is valid for an operator node to have no children, in which case this member property may be omitted.
- Type:
list[ExpressionNode] | None
- function¶
Enumeration constant that identifies all the built-in functions. This value will always be provided when the service generates the object. When the client generates the object it may use this field by itself to specify the function. This value by itself is insufficient to identify the function if it is set to CUSTOM or THIRD_PARTY, in which case the custom_function value must be provided. This property is required in the predicate model but can be replaced by ‘function_prompt’ in the expression model.
- Type:
Function | None
- function_properties¶
The list of additional properties associated with the function. This is most useful when the function is ‘RANK’, as we’ll need the “by_value” and “ascending” properties. This field is only used in a custom expression tree.
- Type:
list[FunctionProperty] | None
- function_prompt¶
The prompt used by this function. This field is only used in a custom expression tree.
- Type:
SchemaObjectReference | None
- level_type¶
Enumeration value indicating how the predicate’s level should be determined.
If there is a level it is usually taken to be the same level as is used in the display grid, or which was used to obtain the data. There is also an option to specify an absolute level as part of the predicate definition.
This field is only used in a custom expression tree.
- Type:
LevelType | None
- level¶
This field is only used in a custom expression tree.
- Type:
list[SchemaObjectReference] | None
- node_property¶
A property used for persisting back-compatibility information for the filter editing. Usually it will not show. If it’s displayed in the response, you should consider include it with the same value in the same node in the request body when you’re performing the PUT/POST/PATCH.
If you don’t put it back in the request, there can be some behavior difference in Filter Expression Editors of other Strategy One apps.
- Type:
int | None
- enum LevelType(value)¶
Bases:
AutoName
Enumeration value indicating how the predicate’s level should be determined
Valid values are as follows:
- NONE = LevelType.NONE¶
- METRIC_LEVEL = LevelType.METRIC_LEVEL¶
- GRID_LEVEL = LevelType.GRID_LEVEL¶
- EXPLICIT_LEVEL = LevelType.EXPLICIT_LEVEL¶
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
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) – (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
- children: list[ExpressionNode] | None = None¶
- custom_function: SchemaObjectReference | None = None¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- function_prompt: SchemaObjectReference | None = None¶
- function_properties: list[FunctionProperty] | None = None¶
- level: list[SchemaObjectReference] | None = None¶
- node_property: int | None = None¶
- class mstrio.modeling.expression.expression_nodes.PredicateNode(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None)¶
Bases:
ExpressionNode
Base class for all predicate nodes.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
- predicate_id¶
String identifier that uniquely identifies this predicate within the context of its larger filter. Any non-empty string of printable characters can be used as a predicate.
- Type:
str | None
- predicate_text¶
Text representation of a predicate
- Type:
str | 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- class mstrio.modeling.expression.expression_nodes.PromptPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, prompt)¶
Bases:
PredicateNode
Specialized expression node for a predicate whose value is prompted at execution time.
This predicate is used for various kinds of expression prompts. At execution time the end user in effect enters an entire predicate (or an even more complex expression). The answer is then substituted into the filter in place of this node.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
prompt (SchemaObjectReference) –
- prompt¶
reference to a prompt, whose value is prompted at execution
- Type:
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- prompt: SchemaObjectReference¶
- class mstrio.modeling.expression.expression_nodes.ReportQualificationPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, report)¶
Bases:
PredicateNode
Specialized expression node that contains a report qualification predicate.
This node is used within filter expressions to represent a predicate whose value is determined by using a report as filter. That is the engine will evaluate a report, and determine the rows that it covers. These filter will consist of these rows.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
report (SchemaObjectReference) –
- report¶
Reference to the child report that should be included in this predicate.
- Type:
- 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶
- report: SchemaObjectReference¶
- class mstrio.modeling.expression.expression_nodes.SetFromRelationshipPredicate(*, expression_type=None, dimty_type=None, dependence_type=None, predicate_id=None, predicate_text=None, level, guide=None, is_independent=IsIndependent.YES, children=None)¶
Bases:
PredicateNode
Specialized expression node that contains a relationship set qualification predicate. In words this predicate describes a qualification of the form “SET of WHERE”.
This node is used within filter expressions to represent a predicate whose value is determined by starting with an arbitrary filter expression at some natural level. This filter is then projected to a filter at a level specified within this predicate by using a relationship. The relationship might be the natural relationship inferred by the engine for the schema, the relationship given by an explicit table, or a relationship implied by a fact (i.e. the engine selects the best table from the set of tables where the given fact is implemented).
This predicate is the only kind of filter predicate that may have a child expression.
- Parameters:
expression_type (ExpressionType | None) –
dimty_type (DimtyType | None) –
dependence_type (DependenceType | None) –
predicate_id (str | None) –
predicate_text (str | None) –
level (list[SchemaObjectReference]) –
guide (SchemaObjectReference | None) –
is_independent (IsIndependent) –
children (list[ExpressionNode] | None) –
- level¶
Within an expression we sometimes need to state at which a computation is performed. In some cases the level is obtained by examining the execution environment. This object is used if the designer wishes to specify an explicit level.
An explicit level is a list of attributes. Alternatively the client may defer selecting an attribute (or attributes) at design time by using a prompt instead. If a prompt is used it should be a choose-attributes prompt, and it may return any number of attributes (including zero).
- Type:
list[SchemaObjectReference]
- guide¶
An optional object that specifies how to relate the child filter with the output filter. There are three options, depending on the nature of the guide object:
The object may be a logicalTable, in which case the filter is projected through this table. The object may be a fact, in which case the filter is projected via one of the tables on which the fact is defined. There might not be a guide object at all, in which case the filter is projected via the engine’s usual join rules (using attribute relationships from the system hierarchy).
- Type:
SchemaObjectReference | None
- is_independent¶
Flag that indicates whether this child filter will be considered independently of other parts of the larger filter:
If set to 1 (the default value, used if this property is omitted)
then this filter will be evaluated by itself.
If set to 0 then other parts of the larger filter will be merged
into this filter. Using this setting could change the value of a metric or relationship set qualification that appears within the child filter.
- Type:
- children¶
List containing the optional root node of the child filter expression. We require that a relationship predicate always has a child filter is always given, but it is possible that the child filter is the empty filter. We model that situation by either omitting the children value or by using an empty list.
This expression is also a filter expression, and it is manipulated in the same manner as the rest of the filter. The predicate ids that appear within this expression must have disjoint values from the predicate ids used in the larger filter. Thus, an individual node within this expression can be manipulated by treating it as a manipulation of the larger filter in the usual manner.
We use a list so that this value matches the list value of the same name used in an operator node.
- Type:
list[ExpressionNode] | 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
- static dispatch(source, connection=None)¶
Method dispatching node data to appropriate class that represents this type of node.
- Parameters:
connection (Connection | None) –
- Return type:
type[’ExpressionNode’]
- 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
- children: list[ExpressionNode] | None = None¶
- dependence_type: DependenceType | None = None¶
- expression_type: ExpressionType | None = None¶
- guide: SchemaObjectReference | None = None¶
- is_independent: IsIndependent = 1¶
- level: list[SchemaObjectReference]¶
- predicate_id: str | None = None¶
- predicate_text: str | None = None¶