# Functions

[Read this page in HTML](https://www.scopedb.io/docs/reference/functions)

Functions calculate values within a ScopeQL query.

## Reading a signature

Signatures use the following notation:

* `<name>`: a value or expression you supply.
* `[ ... ]`: an optional argument. In array construction, element access, and slicing, the brackets are part of the query itself.
* `...`: the preceding item can repeat.

Arguments fall into two groups:

* Inputs such as `<expr>` can vary by row.
* Parameters shown as `name => <value>` must be constant expressions. You can also supply them positionally, in the documented order after the input arguments.

For example, `split(message, separator => ',')` reads `message` from each row and uses one constant separator. Once a named parameter is used, later arguments must also be named.

Type names such as `int`, `float`, and `any` refer to [ScopeQL data types](https://www.scopedb.io/docs/reference/data-types.md). “Any type” means any supported input type; it does not require an `any` cast. Use an explicit cast when a column has a different type from the documented argument, for example `quantile(amount::float, quantile => 0.95)`.

Each entry describes its NULL behavior. Omitting an optional parameter uses its default; passing NULL supplies a value, which the function may reject.

## Function categories

* [Aggregate functions](https://www.scopedb.io/docs/reference/functions/aggregate.md): summarize groups of rows.
* [Window functions](https://www.scopedb.io/docs/reference/functions/window.md): calculate a result for each row using related rows.
* [System functions](https://www.scopedb.io/docs/reference/functions/system.md): inspect ScopeDB runtime information.
* Scalar functions: calculate a value for each row.
  * [Conditional expression functions](https://www.scopedb.io/docs/reference/functions/conditional-expression.md)
  * [Conversion functions](https://www.scopedb.io/docs/reference/functions/conversion.md)
  * [Date and time functions](https://www.scopedb.io/docs/reference/functions/date-and-time.md)
  * [Numeric functions](https://www.scopedb.io/docs/reference/functions/numeric.md)
  * [String functions](https://www.scopedb.io/docs/reference/functions/string.md)
  * [Semi-structured data functions](https://www.scopedb.io/docs/reference/functions/semi-structured-data.md)
