On this page
Kater SQL Functions
All functions (alphabetical)
Every Kater SQL function by name, with its family and what it does.
| Function | Family | What it does |
|---|---|---|
ACROSS | Calculation context | Removes the grouping dimensions you name, in TOTAL, SHARE_OF_TOTAL or VALUE_FOR. |
BY | Calculation context | Keeps only the grouping dimensions you name, in TOTAL, SHARE_OF_TOTAL or VALUE_FOR. |
CALCULATE_ACROSS | Calculation context | Removes the dimensions you name from a measure’s grouping, and keeps the query’s filters. |
CALCULATE_BY | Calculation context | Works a measure out at exactly the dimensions you name, then combines those values for each row. |
CALCULATE_PER | Calculation context | Adds the dimensions you name to the query’s grouping, works the measure out there, then combines those values for each row. |
CLEAR | EVAL and its modifiers | Removes all of the SELECT’s grouping and filters from an EVAL, so the measure is its grand total. |
CUMULATIVE_SHARE | Calculation context | Divides the running total of a value by the sum of all rows, so the last row is 100 percent. |
CURRENT | EVAL and its modifiers | Gives a dimension’s value on the row being worked out, inside a SET in an EVAL. |
CUSTOM_CALCULATION | Field declarations | Declares a custom calculation: a value worked out over the rows of the query’s result, such as a rank or a running total. |
DIMENSION | Field declarations | Declares a dimension: a value on each row that a reader groups by and filters by. |
EVAL | EVAL and its modifiers | Works out a measure on each row, at the SELECT’s grouping and with its filters. |
EXCEL | Field declarations | Writes a field’s whole value as an Excel formula over the columns of the query’s result. |
IGNORE_FILTERS | Calculation context | Removes the query’s filters on the dimensions you name, in TOTAL, SHARE_OF_TOTAL or VALUE_FOR. |
KATER__ALWAYS_BY | Calculate at | The measure worked out by exactly the fields you name, whatever the query groups by. |
KATER__AVG | Aggregations | The average of the field’s values. |
KATER__BUCKET | Derive | A label for the band of numbers that each value is in. |
KATER__CALCULATE_PER | Calculate at | The measure worked out by the query’s grouping and the fields you name, then combined back to the query’s grouping. |
KATER__COUNT | Aggregations | How many rows have a value in the field. |
KATER__COUNT_DISTINCT | Aggregations | How many different values the field has. |
KATER__COUNT_FALSE | Aggregations | How many rows have FALSE in the field. |
KATER__COUNT_TRUE | Aggregations | How many rows have TRUE in the field. |
KATER__DATE | Date grains | The date, without its time of day. |
KATER__DAY_OF_MONTH | Date parts | The day of its month, from 1 to 31. |
KATER__DAY_OF_QUARTER | Date parts | The day of its quarter, counted from 1. |
KATER__DAY_OF_WEEK | Date parts | The day’s short name, such as Mon. |
KATER__DAY_OF_WEEK_INDEX | Date parts | The day’s number in its week, from 0 for Sunday to 6 for Saturday. |
KATER__DAY_OF_YEAR | Date parts | The day of its year, from 1 to 366. |
KATER__DELTA | Windows | The value minus the value on the row before. |
KATER__FIRST_VALUE | Windows | The value on the first row of its partition, in the OVER’s order. |
KATER__HOUR | Date grains | The start of the hour the timestamp is in. |
KATER__HOUR_OF_DAY | Date parts | The hour of its day, from 0 to 23. |
KATER__IGNORE_GROUPING_BY | Calculate at | The measure worked out without the grouping and the filters of the fields you name. |
KATER__IS_AFTER | Date conditions | True where the date is after the value. |
KATER__IS_AT_LEAST | Conditions | True where the field is greater than or equal to the value. |
KATER__IS_AT_MOST | Conditions | True where the field is less than or equal to the value. |
KATER__IS_BEFORE | Date conditions | True where the date is before the value. |
KATER__IS_BETWEEN | Conditions | True where the field is between the low and the high end, both ends included. |
KATER__IS_EQUAL_TO | Conditions | True where the field equals the value. |
KATER__IS_GREATER_THAN | Conditions | True where the field is greater than the value. |
KATER__IS_IN_BOTTOM | Top N | True where the value ranks in the bottom count of the query’s rows, ties included. |
KATER__IS_IN_TOP | Top N | True where the value ranks in the top count of the query’s rows, ties included. |
KATER__IS_LESS_THAN | Conditions | True where the field is less than the value. |
KATER__IS_NOT_EQUAL_TO | Conditions | True where the field does not equal the value. |
KATER__IS_NOT_NULL | Conditions | True where the field has a value. |
KATER__IS_NOT_ON | Date conditions | True where the date is not the value. |
KATER__IS_NOT_ONE_OF | Conditions | True where the field equals none of the values. |
KATER__IS_NULL | Conditions | True where the field is empty. |
KATER__IS_ON | Date conditions | True where the date is the value. |
KATER__IS_ONE_OF | Conditions | True where the field equals one of the values. |
KATER__IS_ON_OR_AFTER | Date conditions | True where the date is on or after the value. |
KATER__IS_ON_OR_BEFORE | Date conditions | True where the date is on or before the value. |
KATER__IS_WITHIN_LAST | Date conditions | True where the date is in the last few periods, counted back from today or from end. |
KATER__LAG | Windows | The value from an earlier row, offset rows back in the OVER’s order. |
KATER__LAST_VALUE | Windows | The value on the last row of its partition, in the OVER’s order. |
KATER__LEAD | Windows | The value from a later row, offset rows on in the OVER’s order. |
KATER__LIST | Aggregations | The field’s different values, as one text value. |
KATER__MAP | Derive | A label for each value you list, and one label for every other value. |
KATER__MAX | Aggregations | The largest value of the field. |
KATER__MILLISECOND | Date grains | The start of the millisecond the timestamp is in. |
KATER__MIN | Aggregations | The smallest value of the field. |
KATER__MINUTE | Date grains | The start of the minute the timestamp is in. |
KATER__MINUTE_OF_HOUR | Date parts | The minute of its hour, from 0 to 59. |
KATER__MONTH | Date grains | The first day of the month the date is in. |
KATER__MONTH_NAME | Date parts | The month’s short name, such as Jan. |
KATER__MONTH_NUM | Date parts | The month’s number, from 1 to 12. |
KATER__PERCENT_CHANGE | Calendar comparisons | The change from the baseline to the current value, as a share of the baseline. |
KATER__PERCENT_DELTA | Windows | The change from the row before, as a share of that row’s value. |
KATER__PERIODS_SINCE | Derive | How many whole periods there are from the since date to this date. |
KATER__PERIOD_SHIFT | Calendar comparisons | The measure for the period a set number of steps before or after each row’s period. |
KATER__PREVIOUS_PERIOD | Calendar comparisons | The measure for the period before each row’s period, such as the month before each month. |
KATER__QUARTER | Date grains | The first day of the quarter the date is in. |
KATER__QUARTER_OF_YEAR | Date parts | The quarter’s number, from 1 to 4. |
KATER__RANK | Windows | The value’s rank among the rows, with 1 for the largest or the smallest value. |
KATER__ROW_NUMBER | Windows | The row’s place when the rows are sorted by the value, from 1. |
KATER__ROW_TOTAL | Totals | The value and the other fields added up on each row, as a spreadsheet’s row total. |
KATER__SAME_PERIOD_LAST_YEAR | Calendar comparisons | The measure for the same period one year earlier, such as March 2025 for March 2026. |
KATER__SAME_WEEKDAY_LAST_WEEK | Calendar comparisons | The measure for the same day of the week, one week earlier. |
KATER__SECOND | Date grains | The start of the second the timestamp is in. |
KATER__SHARE_OF_TOTAL | Windows | The value as a share of the total of all the rows in its partition. |
KATER__SUM | Aggregations | The total of the field’s values. |
KATER__TEXT_CONTAINS | Conditions | True where the text contains the value, in any letter case. |
KATER__TEXT_DOES_NOT_CONTAIN | Conditions | True where the text does not contain the value, in any letter case. |
KATER__TOTAL | Totals | The total of the value over every row of the query, or over the rows of each group its PARTITION BY names. |
KATER__WEEK | Date grains | The first day of the week the date is in. |
KATER__WEEK_OF_YEAR | Date parts | The ISO week of its year, from 1 to 53. |
KATER__WINDOW_AGGREGATION | Windows | A running or trailing aggregate of the value, row by row in the OVER’s order. |
KATER__YEAR | Date grains | The first day of the year the date is in. |
MEASURE | Field declarations | Declares a measure: an aggregate that Kater works out again at each reader’s grouping. |
MOVING_AVERAGE | Calculation context | Averages a value over this row and the rows before it, in the order you give. |
NOT_ADDITIVE_ACROSS | Field declarations | Names the dimensions that a measure cannot be added up across, such as an amount across currencies. |
OPTIONAL_FILTER | Filters | Declares a filter that a reader switches on. |
RATIO | Calculation context | Divides one value by another on each row, such as units by orders. |
REMOVE | EVAL and its modifiers | Removes the dimensions you name from an EVAL’s grouping and from its filters. |
REQUIRED_FILTER | Filters | Declares a filter that always applies. |
RUNNING_TOTAL | Calculation context | Adds up a value from the first row of the result through each row, in the order you give. |
SET | EVAL and its modifiers | Replaces one dimension’s grouping and filter with one value. |
SET_CUSTOM | EVAL and its modifiers | Replaces all of an EVAL’s grouping and filters with one condition of your own. |
SHARE_OF_TOTAL | Calculation context | Divides a measure on each row by its total at a broader grouping. |
TOTAL | Calculation context | Works a measure out at a broader grouping, such as all channels, on each row. |
VALUE_FOR | Calculation context | Works a measure out for one value of a dimension, such as the web channel, on each row. |