Skip to main content
On this page

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

ArgumentDescription
dimensionA 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

  • REMOVE drops the query’s filters on those dimensions too. To keep the filters, use TOTAL with ACROSS, or CALCULATE_ACROSS.
  • Write one REMOVE in an EVAL, 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 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

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