Chart, Table, and SAQL Modes

A CRM Analytics lens can display the same query three ways — chart mode with the chart picker and formatting panel, table mode (values, compare, and pivot tables), and advanced SAQL mode where you read and hand-edit the generated query.

Chart, Table, and SAQL Modes

Everything in the last lesson built one query. What changes now is how that query's result is presented — and a lens gives you three modes to choose from. Same data, same query, three very different jobs.

The mode switcher sits on the left edge of the lens: a chart icon, a table icon, and an advanced-editor icon.

Chart mode

For seeing shape — comparison, trend, distribution, outliers. The default, and where most explorations live.

Table mode

For reading exact values, checking raw rows, and building cross-tabs with derived columns.

Advanced (SAQL) mode

For everything the UI can't express — and for learning what the UI has been writing on your behalf.

Chart mode

Click the chart-type icon and you get the chart picker: bar, column, stacked, line, timeline, donut, funnel, scatter, heat map, geo maps, and a good few more. The picker greys out types your current query can't support — a donut needs a grouping, a scatter needs two measures — which is a useful hint about what your query is missing.

Next to it is the formatting / properties panel, and it's worth spending real time in. This is where you set:

  • Axis labels and ranges — including forcing an axis to start at zero, which stops a bar chart from lying about the size of a difference.
  • Legend position, or turning it off when the chart is self-explanatory.
  • Value labels on the bars themselves, so readers don't have to eyeball against an axis.
  • Number formatting — abbreviated (1.2M), decimal places, prefixes.
  • Sort order, colors, and reference lines.
Formatting you apply in a lens travels with it. Get the chart looking right here, before you clip it to a dashboard — otherwise you'll be redoing the same formatting inside every dashboard that uses it.

Table mode

Switch to the table icon and you get three distinct table types. They are genuinely different tools, not variations on a theme.

Values table

The values table shows raw rows — no aggregation at all. This is your window into the actual records behind a number, and it's the single most useful debugging tool in the product. Total looks doubled? Open a values table, filter to one account, and count the rows. You'll usually spot the fan-out join immediately.

It opens with a set of default columns chosen from the dataset's metadata (which you can change — that's the next lesson). Add or remove columns from the field list on the left.

Compare table

The compare table is the aggregated, spreadsheet-style view: groupings down the left, measures across the top. Its superpower is the formula editor — you can add a derived column computed from the other columns in the table.

That's how you build things the query alone won't give you:

  • Win rate — won amount divided by total amount, formatted as a percent.
  • Variance to target — actual minus quota.
  • Percent of total — a column's value against the grand total.
  • Averages per group — one measure divided by another.

Each derived column gets its own formula, its own number format, and can itself be referenced by later columns. The compare table is where a lens stops being a chart and starts being analysis.

Pivot table

The pivot table crosses two dimensions — one down the rows, one across the columns — with the measure in the cells. Stage down the side, quarter across the top, sum of amount in the middle. It's the classic cross-tab, and it's the right answer whenever someone says "I want it like Excel."

Advanced (SAQL) mode

The last icon opens the advanced editor, showing the SAQL the lens has been generating all along. It reads roughly like this:

q = load "Opportunities";
q = filter q by 'StageName' == "Closed Won";
q = group q by 'Industry';
q = foreach q generate 'Industry' as 'Industry', sum('Amount') as 'sum_Amount';
q = order q by 'sum_Amount' desc;
q = limit q 10;

Every clause maps to something you clicked: filter is your filter bar, group is your bar/grouping, foreach ... generate is your measures, order and limit are your sort and query limit.

You can edit it directly and run it. That unlocks things the point-and-click UI simply cannot express — multi-step queries, cogroup to combine two streams from the same dataset, windowing functions for running totals and rank, case statements for custom bucketing, and computed measures inside the foreach.

Editing SAQL is a one-way door for that lens. Once you hand-edit the query, the visual explorer can no longer round-trip it, and you keep working in SAQL from then on. Do your clicking first, get as close as you can, then drop into the editor for the last mile.

Which mode, when

  1. 1

    Start in chart mode

    You're looking for shape and outliers. If the chart answers the question, you're done.

  2. 2

    Drop to a values table to verify

    Whenever a number surprises you, look at the raw rows before you believe it or blame the dataset.

  3. 3

    Use a compare table for derived metrics

    Rates, ratios, variances, percent-of-total — anything that needs a formula across columns.

  4. 4

    Use a pivot table for cross-tabs

    Two dimensions and one measure, laid out like a spreadsheet, for people who want to read exact values.

  5. 5

    Go to SAQL last

    When the UI has run out of road, or when you want to learn what it's been writing for you.

The advanced editor also exposes one thing worth remembering for the next lesson: it shows API names, not the friendly labels you see in the UI. Which raises the obvious question — where do those labels come from, and how do you change them? That's the Fields panel, and it's next.

Discussion

No comments yet — be the first to start the discussion.