SAQL — the queries behind the widgets

10 Jul 2026 1 min Swarnil Singhai

Every widget is a query. Understanding SAQL lets you build what point-and-click can't.

Anatomy of a SAQL query

q = load "Sales_Funnel";
q = filter q by 'IsClosed' == "false";
q = group q by 'StageBucket';
q = foreach q generate 'StageBucket' as 'Stage', count() as 'Opps', sum('Amount') as 'Pipeline';
q = order q by 'Opps' desc;

When to drop to SAQL

  • Custom funnel ordering
  • Windowed or comparison metrics
  • Multi-step calculations the UI won't express

Advertisement