Query Datasets and Salesforce Objects with New Step Types

Wave designer dashboards support more step types, which allow you to query Salesforce objects and datasets.

You can manually define the following new step types in the dashboard JSON. You can’t use these step types in compact form.

saql Step Type

Use the saql step type for special cases when querying a Wave dataset. With this step type, you can write a custom SAQL query to create derived fields in a values table. You can specify dimensions without groupings. Also, you can bind the dataset name or entire query. For example, you can bind this step type to a static step that provides different SAQL queries or datasets.

Here’s an example of the JSON syntax for a saql step.
"Oppty2ProdSAQL": {
  "type": "saql",
  "label": "Oppty2ProdSAQL",
  "query": "q = load \"Goppty\";
            q = group q by id; 
            q = foreach q generate id as 'id', 
                                   first('Account') as 'Account', 
                                   sum(Oppty_Amount) as 'sum_Oppty_Amount';",
  "isFacet": true,
  "useGlobal": true,
  "selectMode": "single"
}
Tip

Tip

For the query to return dimensions that aren’t included in groupings, use the first() function. In the example, because there’s a unique id for each opportunity record, the first retrieved account for each ID is the right account—it’s actually the only account. If there were duplicate IDs for an opportunity, the query would assign the wrong account to all subsequent opportunities after the first one.

Property Description
type Step type. Set to saql.
label Step label.
query SAQL query. For more information about SAQL queries, see Wave Analytics SAQL Reference.
isFacet

Enables this step to facet and be faceted by other steps. Faceting is when a selection in a widget filters other steps in the dashboard. By default, steps from the same dataset are faceted. To facet steps from different datasets, connect the data sources. The autofilter property is not required to enable faceting for these step types.

useGlobal Apply global filters to this step.

soql Step Type

Use to directly query Salesforce objects—both standard and custom—to get Salesforce data that’s not available in datasets. You can also query external objects created with an OData adapter for Salesforce Connect. For more information about using Salesforce Connect to access external data, see the Salesforce Connect online help. The user viewing the dashboard must have access to the object and fields queried by the soql step.

Here’s an example of the JSON syntax for a soql step.
"soql": {
  "type": "soql",
  "query": "SELECT Name from ACCOUNT",
  "strings": ["Name"],
  "numbers": [],
  "groups": [],
  "selectMode": "single"
}
Property Description
type Step type. Set to soql.
label Step label.
query SOQL query. For more information about SOQL queries, see Force.com SOQL and SOSL Reference.
strings Flags the specified fields as non-grouping dimensions. For example, you can flag a field as a dimension for a values table in which no groupings are allowed.
numbers Flags the specified fields as measures.
groups Flags the specified fields as groupings. For example, you can flag a field as a grouping for a pivot table or chart.

The isFacet and useGlobal properties don’t apply to this step type. You can use a binding to filter other steps based on a selection in a soql step.

Note

Note

You can also optionally specify the “strings”, “numbers”, and “groups” step properties for static steps. Specify these properties to apply a static step to a widget that requires groupings or measures.