ClickHouse Functions

ClickHouse function reference for TypeScript developers

A curated set of common ClickHouse functions for analytics, with SQL and hypequery examples for date bucketing, aggregation, string manipulation, conditionals, and numeric bucketing.

Functions covered

20

Clusters

Date · Aggregate · String · Conditional · Math

Each page includes

SQL + query-builder examples

Date Functions

Date and time functions for bucketing, truncating, and formatting timestamps — the foundation of every ClickHouse analytics query.

Aggregate Functions

Aggregate functions for counting, summing, averaging, and estimating cardinality across millions of rows.

String Functions

String manipulation functions for formatting display values, parsing, and building composite keys.

Conditional Functions

Conditional expressions for inline branching, NULL handling, and multi-way value selection.

Math Functions

Math functions for rounding, integer arithmetic, and numeric bucketing.

Get started

Use common ClickHouse functions in typed TypeScript queries

hypequery generates a TypeScript schema from your live ClickHouse database. These examples show how to combine ClickHouse functions with the query builder, while using raw SQL expressions when the function is not wrapped by a dedicated helper.