Tableau CRM SAQL Developer Guide
Summer '26 (API version 67.0)
Spring '26 (API version 66.0)
Winter '26 (API version 65.0)
Summer '25 (API version 64.0)
Spring '25 (API version 63.0)
Winter '25 (API version 62.0)
Summer '24 (API version 61.0)
Spring '24 (API version 60.0)
Winter '24 (API version 59.0)
Summer '23 (API version 58.0)
Spring '23 (API version 57.0)
Winter '23 (API version 56.0)
Summer '22 (API version 55.0)
Spring '22 (API version 54.0)
Winter '22 (API version 53.0)
Summer '21 (API version 52.0)
Spring '21 (API version 51.0)
Winter '21 (API version 50.0)
Summer '20 (API version 49.0)
Spring '20 (API version 48.0)
Winter '20 (API version 47.0)
Summer '19 (API version 46.0)
Spring '19 (API version 45.0)
Winter '19 (API version 44.0)
Summer '18 (API version 43.0)
Spring '18 (API version 42.0)
Winter '18 (API version 41.0)
Summer '17 (API version 40.0)
Spring '17 (API version 39.0)
Winter '17 (API version 38.0)
Summer '16 (API version 37.0)
Spring '16 (API version 36.0)
Winter '16 (API version 35.0)
Analyze Your Data Over Time
Calculate How Long Activities Take
Display the Opportunities Closed This Month
Forecast Future Data Points with timeseries
Combine Data from Multiple Data Streams with cogroup
Replace Null Values with coalesce()
Dynamically Display Your Top Five Reps with Windowing
Append Datasets using union
Calculate the Slope of the Regression Line
Show the Top and Bottom Quartile
Calculate Grand Totals and Subtotals with the rollup Modifier and grouping() Function
Newer Version Available
Examples
These hands-on SAQL examples walk you through writing a query to retrieve data
-
Analyze Your Data Over Time
Use SAQL date functions for advanced time-based analysis. -
Calculate How Long Activities Take
Use daysBetween() and date_diff() to calculate the difference between two dates or times. -
Display the Opportunities Closed This Month
Use relative date ranges to filter opportunities closed in the current month. -
Forecast Future Data Points with timeseries
Use existing data to predict what might happen in the future. -
Combine Data from Multiple Data Streams with cogroup
You can combine data from two or more data streams into a single data stream using cogroup. The data streams must have at least one common field. -
Replace Null Values with coalesce()
When you use a left outer or full outer cogroup, unmatched data comes through as null. Use coalesce() to replace null values with the value of your choice. -
Dynamically Display Your Top Five Reps with Windowing
Windowing functions perform calculations over a dynamic range. -
Append Datasets using union
You can append data from two or more data streams into a single data stream using union. The data streams must have the same field names and structure. -
Calculate the Slope of the Regression Line
Use SAQL to perform linear analysis on your data to find the line that best fits the data. Then use .regr_slope to return the slope of this line. -
Show the Top and Bottom Quartile
Use SAQL to calculate percentiles, like the top and bottom quartile of your data. -
Calculate Grand Totals and Subtotals with the rollup Modifier and grouping() Function
Calculate subtotals of grouped data in your SAQL query using the rollup modifier on the group by statement, then work with subtotaled data using grouping(). For example, to see the subtotaled value of opportunities by type and lead source, roll up the type and lead source groups. Then, label the subtotals with the grouping function.