Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions contents/docs/sql/expressions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ Expressions can use operators to filter and combine data. These include:
- Logical operators like `AND`, `OR`, `IS` or `NOT`
- Arithmetic operators like `+`, `-`, `*`, `/`

HogQL treats missing properties as `NULL`. A filter such as `properties.plan != ''` also matches events where `plan` is missing.

To keep only events with a non-empty `plan` string, check for both `NULL` and an empty string:

```sql
SELECT event
FROM events
WHERE properties.plan IS NOT NULL
AND properties.plan != ''
```

## Functions and aggregations

You can filter, modify, or aggregate accessed data with [supported ClickHouse functions](/docs/sql/clickhouse-functions) like `dateDiff()` and `concat()` and [aggregations](/docs/hogql/aggregations) like `sumIf()` and `count()`.
Expand Down
Loading