Execute an Analytics query.
Examples for analytics query
sf analytics query -f query.saql
sf analytics query -f query.sql -t America/Denver
sf analytics query -q "..." --sql --limit 10 -r csv
Command Syntax
-
sf analytics query-
: [
--json][
--apiversionAPIVERSION]-oTARGETORG[
-fQUERYFILE][
-qQUERY][
--nomapnames][
--sql][
-tTIMEZONE][
--connectorCONNECTOR][
--limitLIMIT][
-rRESULTFORMAT]
-
Parameters
-
--json-
: Optional
Format output as JSON.
Type: boolean
-
-
--api-versionAPIVERSION-
: Optional
Override the API version used for API requests made by this command.
Type: string
-
-
-oTARGETORG-
: Required
Username or alias of the target org. Not required if the target-org configuration variable is set.
Type: string
-
-
-f|--queryfileQUERYFILE-
: Optional
Path to the file containing the query to execute.
Type: filepath
-
-
-q|--queryQUERY-
: Optional
The query to execute.
Type: string
-
-
--nomapnames-
: Optional
Skip mapping dataset names in the SAQL query to ids.
Type: boolean
-
-
--sql-
: Optional
Execute the query as SQL.
Type: boolean
-
-
-t|--timezoneTIMEZONE-
: Optional
The timezone for the query.
Type: string
-
-
--connectorCONNECTOR-
: Optional
Execute the SQL query against this external data connector id or name.
Type: string
-
-
--limitLIMIT-
: Optional
The maximum number of rows to include.
Type: number
-
-
-r|--resultformatRESULTFORMAT-
: Optional
Result format emitted to stdout.
Type: enum
Permissible values are: human, csv, json
Default value: human
-