Filter {mstrio} | R Documentation |
Create filters that may be passed to MicroStrategy Report/Cube objects.
Description
Pass ids of all objects and selected objects (attributes, metrics and elements) and the generate the requested objects and view filter body for the pull Data API.
Public fields
attributes
List of ids of all attribute objects of given cube/report.
metrics
List of ids of all metrics objects of given cube/report.
attr_elements
(optional) List of ids of all attribute elements of given cube/report.
selected_attributes
List of ids for selected attributes.
selected_metrics
List of ids for selected metrics.
selected_attr_elements
List of ids for selected attribute elements.
operator
(character, optional): Supported view filter operators are either "In" or "NotIn". This defines whether data will include ("In") or exclude ("NotIn") the supplied attr_elements values.
Methods
Public methods
Method new()
Initialize a filter instance
Usage
Filter$new(attributes, metrics, attr_elements = NULL)
Arguments
attributes
(list): List of all attributes IDs in the cube/report
metrics
(list): List of all metrics IDs in the cube/report
attr_elements
(list, optional): List of all attributes elements IDs in the cube/report. If not #' provided the attribute element object will not be validated on selection
Method select()
Select attribute/metric/attr_element objects to filter data. Selecting empty lists or vectors is supported and means that all objects (attributes/metrics) are deselected. This method eliminates duplicates and provides type validation for attributes/metrics and optionally attribute elements (if attr_elements are fetched before)
Usage
Filter$select(object_id, object_type = "automatic")
Arguments
object_id
(list or character vector) Object IDs to be selected. Provide empty list if the objects of the chosen type are to be deselected. nshould be selected
object_type
(character or NULL, optional) either 'attribute_elements', 'automatic'
Method select_attr_elements()
Usage
Filter$select_attr_elements(attribute_elements)
Method clear()
Usage
Filter$clear(object = "all")
Method filter_body()
Usage
Filter$filter_body()
Method clone()
The objects of this class are cloneable with this method.
Usage
Filter$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.