aggregateflex Step Type Properties
Use the aggregateflex step type to perform aggregate queries on a Analytics dataset. An aggregate query summarizes rows, like returning one row per grouping. For example, this step type can return the total amount per sales rep.
| Field Name | Description |
|---|---|
datasets | An array of datasets used by this step. Specify the alias of each dataset. If the pigql attribute references a dataset that’s not specified here, the dashboard doesn’t render. |
broadcastFacet | Controls whether the step’s selections are broadcasted as facets. Faceting is when a selection in a widget filters other steps in the dashboard. Default is true. |
receiveFacetSource | Controls whether the step in the receiving query listens for broadcasted facets and applies them as filters. The mode can be “all”, “none”, “include”, or “exclude”. Use steps to list which steps to include or exclude. Default is all. |
isGlobal | This applies to global filters created before Winter ‘18 only. Newer global filters, those created in the global filter panel widget, don’t require a step. Default is false. You can apply this property only on steps that are connected to a global filter widget—all other steps ignore this property. A global filter filters other steps in the dashboard that have useGlobal set to true and reference the same dataset. |
label | Step label, which is primarily used for display in the dashboard designer user interface. |
query | The query used to retrieve results from a dataset. It must contain at least one grouping and can be in SAQL or compact form. Use a query in SAQL form to customize the query in a way that can’t be done using compact form. |
selectMode | Determines the selection interaction. The options for charts, tables, lists, and toggle selectors are: none, single, singlerequired, multi and multirequired. selectMode doesn’t apply to number, values table, date, range, and global filter widgets. |
start | The initial selections that are applied to the step when the dashboard first opens. |
type | Step type. Set to aggregateflex. If you bind a step property for an aggregateflex step, you must use the correct bindings syntax. For more information about bindings, see the Analytics Bindings Developer Guide. |
visualizationParameters | Visualization details about the step. For more information, see visualizationParameters Properties. |
useGlobal | Indicates whether to apply global filters to this step (true) or not (false). If the step is in SAQL form, you must also set autoFilter to true to apply the global filters. By default, the global filter widget filters compact-form steps only. |
The query can contain the following properties.
sources— The array of sources where data comes from. For more information, see sources Properties.sourceFilters— The filters applied tosources. When you use this object, thesourcesname is thestepskey. the For more information, see filters Properties.aggregateFilters— The array of filters applied on aggregate columns, which are fields where an aggregate function, such as average or sum, is applied to a measure column. Aggregate columns are defined incolumnsundersources. For more information, see filters Propertiesorders— The array of sort orders applied to data in a pivot table. An order can contain the following properties:name— The column or group name used to apply the sort order.ascending: The sort order applied to the data. Indicates whether to order the data in ascending order (true) or not (false).filters— The filters used to sort a measure column in a pivot table and is applied on a dimension value in the pivoted group. For more information about sorting data in a pivot table, see Organize and Summarize Data in a Pivot Table.nulls— The sort order applied to null values in the data. To sort null values last, setnullstolast. To sort null values first, setnullstofirst.
rowTotals— The array of dimension groups to which the values of each row are rolled up. To calculaterowTotals, you must also includecolumnGroupsfor the data.columnTotals— The array of dimension groups to which the values of each column are rolled up. If the query is a grain query, that is, all the columns are non-aggregate columns, or if the query is not grouped by any dimension columns, to calculate totals, setcolumnTotalstoall.columnGroups— The pivoted dimension group, which is the last-defined group. If the defined group is a compound date, such as Year-Month for order date, then include each date grain incolumnGroups. For example,["OrderDate_Year", "OrderDate_Month"].limit— The maximum number of results that the step can return. When you create anaggregateflexstep, by default, CRM Analytics setslimitto 2,000. To return more results, set thelimitattribute accordingly. The higher you increase the limit, the longer the query takes. When a limit isn’t set, Analytics returns up to 10,000 results. For more information, see filters Properties.
Compact Form 2.0 Query Example:
The query can contain the following properties.
-
filters— The filters to apply to the data. For more information, see filters Properties. -
groups— The dimension to group by. -
limit— The maximum number of results that the step can return. When you create anaggregateflexstep, by default, CRM Analytics setslimitto 2,000. To return more results, set thelimitattribute accordingly. The higher you increase the limit, the longer the query takes. When a limit isn’t set, Analytics returns up to 10,000 results. Limit only impacts the number of records returned for display. The limit doesn’t impact calculations across all records in the dataset. For instance, a query groups by Account Name and there are one million Account Names in a dataset. When the limit is 20, Analytics returns 20 records for display. But the summary row provides a total for the one million records. -
measures— The measures returned by the query. If you provide an aggregate function for a measure, then the measure value must be a string, not an array. -
order— Sort order (ascending or descending) of the first specified measure. To order the results in ascending order, setascendingtotrue. To order the results in descending order, setascendingtofalse. If you don’t want to impose a specific order, remove the entire"order"parameter. -
Compact-form (1.0) Query Example:
The query can contain these properties:
-
pigql— Specify the SAQL query to retrieve data from a dataset. When you specify a SAQL query, you must specify the filters, limits, and ordering inside thepigqlattribute. CRM Analytics ignores the following attributes if they are set under thequeryattribute:filters,limit, andorder. -
measures— Defines the fields included as measures. When using a SAQL-form query, you must include each measure in this parameter and in thepigqlparameter. You can change the UI label of a measure by setting thedisplayoption. -
groups— Defines the dimension fields to group by. When using a SAQL-form query, you must specify the group-by dimension in this parameter and in thegroupproperty in thepigqlparameter. -
SAQL-form Query Example:
For more information about SAQL queries, see the Analytics SAQL Developer Guide.
-
steps Properties for Compact Form and SAQL Form
The properties and JSON syntax in the
querynode of anaggregateflexstep type vary based on whether the step is in compact form or SAQL form.