View source: R/analytics-report.R
sf_get_report_instance_results | R Documentation |
Retrieves results for an instance of a report run asynchronously with or without filters. Depending on your asynchronous report run request, data can be at the summary level or include details.
sf_get_report_instance_results(
report_id,
report_instance_id,
labels = TRUE,
guess_types = TRUE,
bind_using_character_cols = deprecated(),
fact_map_key = "T!T",
verbose = FALSE
)
report_id |
|
report_instance_id |
|
labels |
|
guess_types |
|
bind_using_character_cols |
|
fact_map_key |
|
verbose |
|
tbl_df
; the detail report data. More specifically, the detailed
data from the "T!T" entry in the fact map.
Below are the fact map key patterns for three report types:
T!T
: The grand total of a report. Both record data
values and the grand total are represented by this key.
<First level row grouping_second level row grouping_third
level row grouping>!T
: T refers to the row grand total.
<First level row grouping_second level row grouping>!<First
level column grouping_second level column grouping>.
Each item in a row or column grouping is numbered starting with 0. Here are some examples of fact map keys:
The first item in the first-level grouping.
The second item in the first-level grouping.
The first item in the first-level grouping and the first item in the second-level grouping.
The first item in the first-level grouping and the second item in the second-level grouping.
Other Report Instance functions:
sf_delete_report_instance()
,
sf_list_report_instances()
## Not run:
# execute a report asynchronously in your Org
all_reports <- sf_query("SELECT Id, Name FROM Report")
this_report_id <- all_reports$Id[1]
results <- sf_execute_report(this_report_id, async=TRUE)
# check if that report has succeeded, ...
instance_list <- sf_list_report_instances(this_report_id)
instance_status <- instance_list[[which(instance_list$id == results$id), "status"]]
# ... if so, then grab the results
if(instance_status == "Success"){
report_data <- sf_get_report_instance_results(report_id = this_report_id,
report_instance_id = results$id)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.