Learn R Programming

mstrio (version 11.2.1)

Report: Extract a MicroStrategy report into a R Data.Frame

Description

Access, filter, publish, and extract data from in-memory reports. Create a Report object to load basic information on a report dataset. Specify subset of report to be fetched through Report.apply_filters() and Report.clear_filters() . Fetch dataset through

Report.to_dataframe() method. Attributes: connection: MicroStrategy connection object returned by `microstrategy.Connection()`. report_id: Identifier of a pre-existing report containing the required data. parallel (bool, optional): If True, use asynchronous requests to download data. If False (default), this feature will be disabled.

Arguments

Public fields

connection

MicroStrategy connection object

report_id

Identifier of a report.

Methods

Public methods

Method new()

Usage

Report$new(connection, report_id, parallel = FALSE)

Method to_dataframe()

Usage

Report$to_dataframe(limit = NULL, callback = function(x, y) {
})

Method apply_filters()

Usage

Report$apply_filters(attributes = NULL, metrics = NULL, attr_elements = NULL)

Method clear_filters()

Usage

Report$clear_filters()

Method get_attr_elements()

Usage

Report$get_attr_elements(verbose = TRUE)

Method clone()

The objects of this class are cloneable with this method.

Usage

Report$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
# NOT RUN {
# Create a connection object.
connection = connect_mstr(base_url, username, password, project_name)

# Create a report object.
my_report <- Report$new(connection, report_id)

# See attributes and metrics in the report.
my_report$attributes
my_report$metrics
my_report$attr_elements

# Specify attributes and metrics (columns) to be fetched.
my_report$apply_filters(attributes = my_report$attributes[1:2],
                           metrics = my_report$metrics[1:2])

# See the selection of attributes, metrics and attribute elements.
my_report$selected_attributes
my_report$selected_metrics
my_report$selected_attr_elements

# Clear filtering to load a full dataset.
my_report$clear_filters()

# Fetch data from the Intelligence Server.
my_report$to_dataframe()

# See the dataframe.
my_report$dataframe
# }

Run the code above in your browser using DataLab