Newer Version Available
union
Combines multiple result sets into one result set. The result sets must have the same
field names and structure. You can use a different dataset to create each result set, or you can
use the same dataset.
Syntax
Example
Example
You want to see how each rep compares to the average for deals won. You can make this
comparison by appending these two result sets together:
- Total amount of opportunities won for each rep
- Average amount of opportunities won for all reps
First, show the total amount of won opportunities for each rep.
The resulting graph shows the sum of amount for each rep.

Next, calculate the average of the sum of the amounts for each rep using the average
function.
Because the two data streams have the same field names and structure, you can use union to combine them.
The resulting graph contains the sum of amounts by each rep together with the average amount per rep.

Combine the SAQL fragments to get the complete SAQL statement.