Skip to content
Merged
Show file tree
Hide file tree
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
32 changes: 29 additions & 3 deletions references/dimensions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1386,9 +1386,19 @@ You can predefine colors for your string type dimensions, these colors will be u

## Case sensitive

You can control whether string filters on a dimension are case sensitive or case insensitive. By default, all string filters are case sensitive (`case_sensitive: true`). When set to `false`, string filters will ignore case differences when matching values.
You can control whether string filters on a dimension are case sensitive or case insensitive.

This setting affects the following filter operators: `equals`, `not equals`, `starts with`, and `ends with`.
- Default: `case_sensitive: true` (case sensitive)
- When `false`: string filters ignore case differences

This setting affects these string filter operators:

- `equals`
- `not equals`
- `starts with`
- `ends with`
- `includes`
- `doesn't include`

<Tabs>
<Tab title="dbt v1.9 and earlier">
Expand Down Expand Up @@ -1422,7 +1432,23 @@ This setting affects the following filter operators: `equals`, `not equals`, `st
</Tab>
</Tabs>

With `case_sensitive: false`, filtering for "john" would match "John", "JOHN", "john", etc.
### SQL behavior examples

Given a filter value `jes` on a dimension like `customers.first_name`:

- With `case_sensitive: true` (default), generated SQL uses case-sensitive matching, for example:

```sql
("customers"."first_name") LIKE '%jes%'
```

- With `case_sensitive: false`, generated SQL normalizes both sides for case-insensitive matching:

```sql
UPPER("customers"."first_name") LIKE UPPER('%jes%')
```

So with `case_sensitive: false`, filtering for `john` would match `John`, `JOHN`, `john`, etc.

<Info>
Dimension-level `case_sensitive` settings override explore-level and project-level settings. See [Tables reference](/references/tables#case-sensitive) for explore-level configuration and [lightdash.config.yml reference](/references/lightdash-config-yml#defaults-configuration) for project-level defaults.
Expand Down
2 changes: 1 addition & 1 deletion references/tables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ Available intervals: `milliseconds`, `seconds`, `minutes`, `hours`, `days`, `wee

You can control whether string filters are case sensitive or case insensitive at the table level. By default, all string filters are case sensitive (`case_sensitive: true`). When set to `false`, string filters on all dimensions in this table will ignore case differences when matching values.

This setting affects the following filter operators: `equals`, `not equals`, `starts with`, and `ends with`.
This setting affects the following string filter operators: `equals`, `not equals`, `starts with`, `ends with`, `includes`, and `doesn't include`.

<Tabs>
<Tab title="dbt v1.9 and earlier">
Expand Down
Loading