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
| Argument | Description |
|---|---|
dimension | A 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.
EVALwithREMOVEdrops them as well. - A call takes one
BYor oneACROSS, 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 ordersWHERE KATER__IS_EQUAL_TO(orders.region, 'AMER')GROUP BY orders.region, orders.channelORDER BY 2| Region | Channel | Units | Units on All Channels |
|---|---|---|---|
| AMER | 546 | 2,179 | |
| AMER | paid | 604 | 2,179 |
| AMER | store | 534 | 2,179 |
| AMER | web | 495 | 2,179 |