Skip to main content
On this page

Kater SQL Functions

All functions (alphabetical)

Every Kater SQL function by name, with its family and what it does.

FunctionFamilyWhat it does
ACROSSCalculation contextRemoves the grouping dimensions you name, in TOTAL, SHARE_OF_TOTAL or VALUE_FOR.
BYCalculation contextKeeps only the grouping dimensions you name, in TOTAL, SHARE_OF_TOTAL or VALUE_FOR.
CALCULATE_ACROSSCalculation contextRemoves the dimensions you name from a measure’s grouping, and keeps the query’s filters.
CALCULATE_BYCalculation contextWorks a measure out at exactly the dimensions you name, then combines those values for each row.
CALCULATE_PERCalculation contextAdds the dimensions you name to the query’s grouping, works the measure out there, then combines those values for each row.
CLEAREVAL and its modifiersRemoves all of the SELECT’s grouping and filters from an EVAL, so the measure is its grand total.
CUMULATIVE_SHARECalculation contextDivides the running total of a value by the sum of all rows, so the last row is 100 percent.
CURRENTEVAL and its modifiersGives a dimension’s value on the row being worked out, inside a SET in an EVAL.
CUSTOM_CALCULATIONField declarationsDeclares a custom calculation: a value worked out over the rows of the query’s result, such as a rank or a running total.
DIMENSIONField declarationsDeclares a dimension: a value on each row that a reader groups by and filters by.
EVALEVAL and its modifiersWorks out a measure on each row, at the SELECT’s grouping and with its filters.
EXCELField declarationsWrites a field’s whole value as an Excel formula over the columns of the query’s result.
IGNORE_FILTERSCalculation contextRemoves the query’s filters on the dimensions you name, in TOTAL, SHARE_OF_TOTAL or VALUE_FOR.
KATER__ALWAYS_BYCalculate atThe measure worked out by exactly the fields you name, whatever the query groups by.
KATER__AVGAggregationsThe average of the field’s values.
KATER__BUCKETDeriveA label for the band of numbers that each value is in.
KATER__CALCULATE_PERCalculate atThe measure worked out by the query’s grouping and the fields you name, then combined back to the query’s grouping.
KATER__COUNTAggregationsHow many rows have a value in the field.
KATER__COUNT_DISTINCTAggregationsHow many different values the field has.
KATER__COUNT_FALSEAggregationsHow many rows have FALSE in the field.
KATER__COUNT_TRUEAggregationsHow many rows have TRUE in the field.
KATER__DATEDate grainsThe date, without its time of day.
KATER__DAY_OF_MONTHDate partsThe day of its month, from 1 to 31.
KATER__DAY_OF_QUARTERDate partsThe day of its quarter, counted from 1.
KATER__DAY_OF_WEEKDate partsThe day’s short name, such as Mon.
KATER__DAY_OF_WEEK_INDEXDate partsThe day’s number in its week, from 0 for Sunday to 6 for Saturday.
KATER__DAY_OF_YEARDate partsThe day of its year, from 1 to 366.
KATER__DELTAWindowsThe value minus the value on the row before.
KATER__FIRST_VALUEWindowsThe value on the first row of its partition, in the OVER’s order.
KATER__HOURDate grainsThe start of the hour the timestamp is in.
KATER__HOUR_OF_DAYDate partsThe hour of its day, from 0 to 23.
KATER__IGNORE_GROUPING_BYCalculate atThe measure worked out without the grouping and the filters of the fields you name.
KATER__IS_AFTERDate conditionsTrue where the date is after the value.
KATER__IS_AT_LEASTConditionsTrue where the field is greater than or equal to the value.
KATER__IS_AT_MOSTConditionsTrue where the field is less than or equal to the value.
KATER__IS_BEFOREDate conditionsTrue where the date is before the value.
KATER__IS_BETWEENConditionsTrue where the field is between the low and the high end, both ends included.
KATER__IS_EQUAL_TOConditionsTrue where the field equals the value.
KATER__IS_GREATER_THANConditionsTrue where the field is greater than the value.
KATER__IS_IN_BOTTOMTop NTrue where the value ranks in the bottom count of the query’s rows, ties included.
KATER__IS_IN_TOPTop NTrue where the value ranks in the top count of the query’s rows, ties included.
KATER__IS_LESS_THANConditionsTrue where the field is less than the value.
KATER__IS_NOT_EQUAL_TOConditionsTrue where the field does not equal the value.
KATER__IS_NOT_NULLConditionsTrue where the field has a value.
KATER__IS_NOT_ONDate conditionsTrue where the date is not the value.
KATER__IS_NOT_ONE_OFConditionsTrue where the field equals none of the values.
KATER__IS_NULLConditionsTrue where the field is empty.
KATER__IS_ONDate conditionsTrue where the date is the value.
KATER__IS_ONE_OFConditionsTrue where the field equals one of the values.
KATER__IS_ON_OR_AFTERDate conditionsTrue where the date is on or after the value.
KATER__IS_ON_OR_BEFOREDate conditionsTrue where the date is on or before the value.
KATER__IS_WITHIN_LASTDate conditionsTrue where the date is in the last few periods, counted back from today or from end.
KATER__LAGWindowsThe value from an earlier row, offset rows back in the OVER’s order.
KATER__LAST_VALUEWindowsThe value on the last row of its partition, in the OVER’s order.
KATER__LEADWindowsThe value from a later row, offset rows on in the OVER’s order.
KATER__LISTAggregationsThe field’s different values, as one text value.
KATER__MAPDeriveA label for each value you list, and one label for every other value.
KATER__MAXAggregationsThe largest value of the field.
KATER__MILLISECONDDate grainsThe start of the millisecond the timestamp is in.
KATER__MINAggregationsThe smallest value of the field.
KATER__MINUTEDate grainsThe start of the minute the timestamp is in.
KATER__MINUTE_OF_HOURDate partsThe minute of its hour, from 0 to 59.
KATER__MONTHDate grainsThe first day of the month the date is in.
KATER__MONTH_NAMEDate partsThe month’s short name, such as Jan.
KATER__MONTH_NUMDate partsThe month’s number, from 1 to 12.
KATER__PERCENT_CHANGECalendar comparisonsThe change from the baseline to the current value, as a share of the baseline.
KATER__PERCENT_DELTAWindowsThe change from the row before, as a share of that row’s value.
KATER__PERIODS_SINCEDeriveHow many whole periods there are from the since date to this date.
KATER__PERIOD_SHIFTCalendar comparisonsThe measure for the period a set number of steps before or after each row’s period.
KATER__PREVIOUS_PERIODCalendar comparisonsThe measure for the period before each row’s period, such as the month before each month.
KATER__QUARTERDate grainsThe first day of the quarter the date is in.
KATER__QUARTER_OF_YEARDate partsThe quarter’s number, from 1 to 4.
KATER__RANKWindowsThe value’s rank among the rows, with 1 for the largest or the smallest value.
KATER__ROW_NUMBERWindowsThe row’s place when the rows are sorted by the value, from 1.
KATER__ROW_TOTALTotalsThe value and the other fields added up on each row, as a spreadsheet’s row total.
KATER__SAME_PERIOD_LAST_YEARCalendar comparisonsThe measure for the same period one year earlier, such as March 2025 for March 2026.
KATER__SAME_WEEKDAY_LAST_WEEKCalendar comparisonsThe measure for the same day of the week, one week earlier.
KATER__SECONDDate grainsThe start of the second the timestamp is in.
KATER__SHARE_OF_TOTALWindowsThe value as a share of the total of all the rows in its partition.
KATER__SUMAggregationsThe total of the field’s values.
KATER__TEXT_CONTAINSConditionsTrue where the text contains the value, in any letter case.
KATER__TEXT_DOES_NOT_CONTAINConditionsTrue where the text does not contain the value, in any letter case.
KATER__TOTALTotalsThe total of the value over every row of the query, or over the rows of each group its PARTITION BY names.
KATER__WEEKDate grainsThe first day of the week the date is in.
KATER__WEEK_OF_YEARDate partsThe ISO week of its year, from 1 to 53.
KATER__WINDOW_AGGREGATIONWindowsA running or trailing aggregate of the value, row by row in the OVER’s order.
KATER__YEARDate grainsThe first day of the year the date is in.
MEASUREField declarationsDeclares a measure: an aggregate that Kater works out again at each reader’s grouping.
MOVING_AVERAGECalculation contextAverages a value over this row and the rows before it, in the order you give.
NOT_ADDITIVE_ACROSSField declarationsNames the dimensions that a measure cannot be added up across, such as an amount across currencies.
OPTIONAL_FILTERFiltersDeclares a filter that a reader switches on.
RATIOCalculation contextDivides one value by another on each row, such as units by orders.
REMOVEEVAL and its modifiersRemoves the dimensions you name from an EVAL’s grouping and from its filters.
REQUIRED_FILTERFiltersDeclares a filter that always applies.
RUNNING_TOTALCalculation contextAdds up a value from the first row of the result through each row, in the order you give.
SETEVAL and its modifiersReplaces one dimension’s grouping and filter with one value.
SET_CUSTOMEVAL and its modifiersReplaces all of an EVAL’s grouping and filters with one condition of your own.
SHARE_OF_TOTALCalculation contextDivides a measure on each row by its total at a broader grouping.
TOTALCalculation contextWorks a measure out at a broader grouping, such as all channels, on each row.
VALUE_FORCalculation contextWorks a measure out for one value of a dimension, such as the web channel, on each row.