Group by column and aggregate another
Table-in, table-out — composes downstream of SELECTs.
THEN GROUP({{ group_by }}, {{ agg_column }})THEN GROUP({{ group_by }}, {{ agg_column }}, {{ agg_func }})| name | type | description |
|---|---|---|
| group_by | VARCHAR | — |
| agg_column | VARCHAR | — |
| agg_func(optional) | VARCHAR | — |
| _table | TABLE | — |
Aggregates rows by key and returns the summed measure
SELECT
*
FROM
(
VALUES
('A', 10),
('A', 15),
('B', 3)
) AS t (category, amount) THEN GROUP ('category', 'amount') THEN PYTHON (
'result = pd.DataFrame({"a_total":[int(df.loc[df["category"] == "A", "amount_sum"].iloc[0])]})'
)Apply theme styling to a chart specification
Analyze query results with LLM based on a prompt
Remove duplicate rows
Add LLM-computed columns to query results
Filter query results using LLM-based semantic matching
Investigative analysis - explores related data to answer questions
Group by column and aggregate another
Table-in, table-out — composes downstream of SELECTs.
THEN GROUP({{ group_by }}, {{ agg_column }})THEN GROUP({{ group_by }}, {{ agg_column }}, {{ agg_func }})| name | type | description |
|---|---|---|
| group_by | VARCHAR | — |
| agg_column | VARCHAR | — |
| agg_func(optional) | VARCHAR | — |
| _table | TABLE | — |
Aggregates rows by key and returns the summed measure
SELECT
*
FROM
(
VALUES
('A', 10),
('A', 15),
('B', 3)
) AS t (category, amount) THEN GROUP ('category', 'amount') THEN PYTHON (
'result = pd.DataFrame({"a_total":[int(df.loc[df["category"] == "A", "amount_sum"].iloc[0])]})'
)Apply theme styling to a chart specification
Analyze query results with LLM based on a prompt
Remove duplicate rows
Add LLM-computed columns to query results
Filter query results using LLM-based semantic matching
Investigative analysis - explores related data to answer questions