Kater SQL Functions EVAL and its modifiers
REMOVE
Removes the dimensions you name from an EVAL's grouping and from its filters.
Family: EVAL and its modifiers
The other dimensions of the context stay. Write it inside EVAL.
Syntax
EVAL(measure, REMOVE(dimension, ...))Arguments
| Argument | Description |
|---|---|
dimension | A dimension of the context, such as orders.channel. Give one or more. |
Returns
The measure without those dimensions, on each row of the result.
Usage notes
REMOVEdrops the query’s filters on those dimensions too. To keep the filters, useTOTALwithACROSS, orCALCULATE_ACROSS.- Write one
REMOVEin anEVAL, with every dimension in it. It cannot be mixed with another modifier. - The measure’s own definition still applies.
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', EVAL(orders.sum__quantity, REMOVE(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 |
Units on All Channels is the units of AMER on every channel. The filter on region stays, because REMOVE names only the channel.
See also
- Change a measure’s context
- Pass through, evaluate or declare
- Other functions in EVAL and its modifiers:
EVAL,CLEAR,SET,SET_CUSTOM,CURRENT