Skip to main content
On this page

Kater SQL Functions Calculation context

ACROSS

Removes the grouping dimensions you name, in TOTAL, SHARE_OF_TOTAL or VALUE_FOR.

Family: Calculation context

The other dimensions stay.

Syntax

TOTAL(measure, ACROSS(dimension, ...))

Arguments

ArgumentDescription
dimensionA dimension that the query groups by. Give one or more.

Returns

Nothing of its own. It sets the grouping of the call that holds it.

Usage notes

  • The query’s filters stay, those on the removed dimensions included. EVAL with REMOVE drops them as well.
  • A call takes one BY or one ACROSS, not both.

Example

This Sandbox query reads the sample shop’s orders. The table shows the rows that Kater gave.

SELECT
orders.region AS "Region",
orders.channel AS "Channel",
EVAL(orders.sum__quantity) AS "Units",
MEASURE('region_units', TOTAL(orders.sum__quantity, ACROSS(orders.channel))) AS "Units on All Channels"
FROM kater_dataset.orders AS orders
WHERE
KATER__IS_EQUAL_TO(orders.region, 'AMER')
GROUP BY
orders.region,
orders.channel
ORDER BY
2
RegionChannelUnitsUnits on All Channels
AMERemail5462,179
AMERpaid6042,179
AMERstore5342,179
AMERweb4952,179

See also