You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a function that takes ids for a database, measures and fields and sends a json request. Here is a snippet on how to do that manually at the moment
# pick a datasetdb_id<-"detouextregsai"db_schema<- sc_schema_db(db_id)
db_uid<- paste0("str:database:", db_id)
# browse the schema to obtain resource idsid_arrivals<-db_schema$Facts$Arrivals$Arrivals$idid_time<-db_schema$`Mandatory fields`$`Season/Tourism Month`$`Season/Tourism Month`$id# get the responsejson_list<-list(database=db_uid, measures=list(id_arrivals), dimensions=list(list(id_time)))
response<-httr::POST(
url= paste0(STATcubeR:::base_url, "/table"),
body=jsonlite::toJSON(json_list, auto_unbox=TRUE),
encode="raw",
config=httr::add_headers(APIKey= sc_key())
)
# convert to class sc_tablemy_table<-STATcubeR:::sc_table_class$new(response)
Transofm this snippet into a function
sc_table_custom(database_id, measures, fields)
The text was updated successfully, but these errors were encountered:
Implement a function that takes ids for a database, measures and fields and sends a json request. Here is a snippet on how to do that manually at the moment
Transofm this snippet into a function
The text was updated successfully, but these errors were encountered: