> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meetsilicon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tables reference

> How dbt models become queryable Tables, and every option for configuring them

Tables in Silicon are built from dbt models (either one, or many joined together).

## Adding Tables to your project

Tables come from dbt models that have been defined in your dbt project's `schema.yml` files.

If your dbt model has been defined in a YAML file, and has at least one column documented, it will appear in Silicon as a table.

For example, if we had this in our `schema.yml` files in dbt, we'd see a Table called **Users** in Silicon.

```yaml theme={null}
models:
  - name: users
    columns:
      - name: user_id
        description: "The unique identified for each user"
```

The [`build your semantic layer` track](https://docs.meetsilicon.com/get-started/build-your-semantic-layer) walks through generating this YAML with the Silicon CLI.

## Choosing which Tables appear in Silicon

Not every dbt model with a YAML file belongs in Silicon -- staging and intermediate models usually shouldn't be queryable by end users. **Tables configuration** in your project settings controls which models become Tables.

To reach it, click the gear icon in the top-right navigation bar, choose **Project settings**, then select **Tables configuration** in the left sidebar. The setting is only visible to users whose [role](https://docs.meetsilicon.com/workspace-admin/roles.md) lets them edit project settings.

| Option | Behavior |
| - | - |
| Show entire project | Every model with a YAML file in your dbt project appears as a Table. |
| Show models with any of these tags | Only models carrying one of the [dbt tags](#limiting-tables-with-dbt-tags) you list appear as Tables. |
| Show models in this list | Only the models you select by name appear as Tables. |

Tables configuration filters models after Silicon compiles them. To skip compilation for models entirely -- which speeds up syncing on large projects -- use the [dbt selector](https://docs.meetsilicon.com/integrations/dbt/projects.md#dbt-selector) in your project settings instead.

### Limiting Tables with dbt tags

Tagging is the most maintainable way to control which models appear, because the decision lives in your dbt project alongside the model rather than in a list someone has to remember to update. Use a set of tags you already maintain, or create a Silicon-specific one.

Add the tag in your model's YAML file:

```yaml dbt v1.10+ theme={null}
models:
  - name: model_name
    config:
      tags: ['silicon']
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: model_name
    tags: ['silicon']
```

```yaml Silicon YAML theme={null}
type: model
name: model_name

tags: ['silicon']
```

Or in the model's SQL file, in the config block:

```sql theme={null}
{{ config(
    tags=["silicon"]
) }}

select ...
```

Then set **Tables configuration** to **Show models with any of these tags** and add the tag:

### Tables configuration vs. dbt selector

Two settings can filter models by dbt tag, and they run at different points in the sync.

**Tables configuration** lives in Project settings and filters *after* Silicon has compiled your dbt project. Every model is still compiled, and Silicon still needs warehouse access to the datasets behind them. The tag list only controls what users see in the UI. Use it when you want to tidy up the Tables list without changing what Silicon pulls from the warehouse.

**[dbt selector](https://docs.meetsilicon.com/integrations/dbt/projects.md#dbt-selector)** lives under the dbt connection's advanced configuration and filters *before* compilation. Anything that doesn't match the selector is never compiled, so its datasets are never queried. It takes full [dbt selection syntax](https://docs.getdbt.com/reference/node-selection/syntax#combining-state-and-result-selectors), for example `tag:silicon`. Use it when you want to reduce what Silicon compiles and needs access to. This is useful on large projects where compilation is slow, or when you want to keep whole subsets of models out of Silicon entirely.

The two can be combined: the dbt selector decides which models Silicon compiles, and Tables configuration then decides which of those models appear as Tables.

## Table configuration

You can customize how Tables look in Silicon by adding configuration to your YAML file. Here's an example of most the properties you can use when defining a Table:

```yaml dbt v1.10+ theme={null}
models:
  - name: users
    config:
      meta:
        label: 'App Users'
        order_fields_by: 'label'
        groups: ['mobile', 'engagement']
        sql_filter: ${date_dimension} >= '2025-01-01'
        primary_key: user_id
        sets:
    	    event_fields:
      	  fields:
              - user_id
              - event_type
        joins:
          - join: events
            sql_on: ${users.user_id} = ${events.user_id}
            fields: [event_fields*]
            relationship: one-to-many
        required_attributes:
          product_team: 'Mobile'
        explores:
          users_pii:
            required_attributes:
              has_pii_access: true
            joins:
              - join: users_pii
                sql_on: ${users.user_id} = ${users_pii.user_id}
                relationship: one-to-one
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: users
    meta:
      label: 'App Users'
      order_fields_by: 'label'
      groups: ['mobile', 'engagement']
      sql_filter: ${date_dimension} >= '2025-01-01'
      primary_key: user_id
      sets:
  	    event_fields:
    	  fields:
            - user_id
            - event_type
      joins:
        - join: events
          sql_on: ${users.user_id} = ${events.user_id}
          fields: [event_fields*]
          relationship: one-to-many
      required_attributes:
        product_team: 'Mobile'
      explores:
        users_pii:
          required_attributes:
            has_pii_access: true
          joins:
            - join: users_pii
              sql_on: ${users.user_id} = ${users_pii.user_id}
              relationship: one-to-one
```

```yaml Silicon YAML theme={null}
type: model
name: users

label: 'App Users'
order_fields_by: 'label'
groups: ['mobile', 'engagement']
sql_filter: ${date_dimension} >= '2025-01-01'
primary_key: user_id
sets:
  event_fields:
    fields:
      - user_id
      - event_type
joins:
  - join: events
    sql_on: ${users.user_id} = ${events.user_id}
    fields: [event_fields*]
    relationship: one-to-many
required_attributes:
  product_team: 'Mobile'
explores:
  users_pii:
    required_attributes:
      has_pii_access: true
    joins:
      - join: users_pii
        sql_on: ${users.user_id} = ${users_pii.user_id}
        relationship: one-to-one
```

### Table properties

| Property | Value | Note |
| :- | :- | :- |
| label | string | Custom label. This is what you'll see in Silicon instead of the Table name. |
| [order\_fields\_by](#order-fields-by) | `index` or `label` | How the fields will be sorted in the sidebar. [Read about the order rules.](#order-fields-by) |
| [joins](https://docs.meetsilicon.com/semantic-layer/joins.md) | array | Join logic to join other data models to the Table. [Read about joins.](https://docs.meetsilicon.com/semantic-layer/joins.md) |
| [metrics](https://docs.meetsilicon.com/semantic-layer/metrics.md#2-using-the-model-meta-tag) | object | Model metrics. [Read about model metrics](https://docs.meetsilicon.com/semantic-layer/metrics.md#2-using-the-model-meta-tag) |
| [groups](#groups) | array of strings | Group tables in the sidebar, with up to 5 levels of nesting. [Read about groups.](#groups) |
| group\_label | string | Deprecated Use [`groups`](#groups) instead. Group tables in the sidebar. |
| [sql\_from](#sql-from) | string | Overrides dbt model relation\_name |
| [sql\_filter](#sql-filter-row-level-security) | string | A permanent filter that will always be applied when querying this table directly. [`Read about sql_filter.`](#sql-filter-row-level-security) |
| [sql\_where](#sql-filter-row-level-security) | string | Alias for `sql_filter` |
| [required\_attributes](#required-attributes) | object | Limits access to users with those attributes (AND logic). [Read about user attributes](https://docs.meetsilicon.com/workspace-admin/user-attributes.md) |
| [any\_attributes](#any-attributes) | object | Limits access to users with those attributes (OR logic). [Read about user attributes](https://docs.meetsilicon.com/workspace-admin/user-attributes.md) |
| group\_details | object | Describes the groups for dimensions and metrics |
| [default\_filters](#default-filters) | array | Dimension filters that will be applied when no other filter on those dimension exists. [`Read about default_filters`](#default-filters) |
| [default\_show\_underlying\_values](#default-show-underlying-values) | array | Default fields shown in "View underlying data" for all metrics in this model. [Read about default\_show\_underlying\_values](#default-show-underlying-values) |
| [explores](#explores) | object | Allows you to define multiple table explores in Silicon from a single dbt model. |
| [hidden](#hiding-the-base-explore) | boolean | If `true`, the model's own explore is not created. The table can still be joined to and used as the base for `explores`. [Read about hiding the base explore.](#hiding-the-base-explore) |
| [parameters](#parameters-configuration) | object | Model-level parameters that can be referenced in SQL properties. [Read about parameters](#parameters-configuration) |
| [sets](#sets) | object | Allows you to define a reference to a collection of fields. This reference can be re-used throughout the model. |
| [case\_sensitive](#case-sensitive) | boolean | If set to `false`, string filters on dimensions in this table will be case insensitive by default. Defaults to `true`. |

### Adding a new dbt model

If you've added a new dbt model to your project, you need to do `dbt run` + `dbt refresh` before it will appear in Silicon.

Silicon gets information about your data models from dbt. But it gets information about the data ***generated*** by those data models from your data warehouse.

This means that if you add a new dbt model to your project or update a model so that you're making changes to the table it generates, then you need to do two things before your changes will appear in Silicon:

1. **Materialize the new table or changes using dbt run.** You want the data in your data warehouse to be the new table you're expecting. So you need to do `dbt run` to update the table from the data model you just changed.
2. **Click Refresh dbt in Silicon or run `silicon refresh` in the CLI.** This will re-sync your dbt project in Silicon so that changes you made to your dbt models are shown in Silicon (e.g. adding a new table or column).

### Order fields by

By default, the fields in your sidebar for any table will appear alphabetically (`order_fields_by: "label"`). Sometimes, you might not want your fields to appear alphabetically, but instead, in the same order as they are in your YAML file. You can achieve this by setting the `order_fields_by` parameter in your table's meta tag to `index`, like this:

```yaml dbt v1.10+ theme={null}
models:
  - name: users
    config:
      meta:
        order_fields_by: 'index'
    columns:
      - name: user_id
      - name: user_name
      - name: user_email
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: users
    meta:
      order_fields_by: 'index'
    columns:
      - name: user_id
      - name: user_name
      - name: user_email
```

```yaml Silicon YAML theme={null}
type: model
name: users

order_fields_by: 'index'

dimensions:
  - name: user_id
  - name: user_name
  - name: user_email
```

So, in the example above, the fields in the sidebar for "My Table" would appear in the order:

* user\_id
* user\_name
* user\_email

Instead of being listed alphabetically.

Here are some other things worth mentioning about the `order_fields_by` parameter:

* By default, `order_fields_by` is set to `label`, which means that your fields will appear in the table listed alphabetically.
* Since metrics can be declared in multiple places within your YAML (as a dbt metric, in the model `meta` tag, under a dimension's `meta`), we force the following order on metrics if you set `order_fields_by` to `index`:
  * dbt metrics appear first
  * then, metrics defined in the model's `meta`
  * then, metrics defined in the dimensions' `meta`
* Group labels inherit the index of the first dimension that use them.

### Groups

Use `groups` to organize tables into nested groups in the sidebar. You can nest up to **5 levels deep** by passing an array of group keys, ordered from outermost to innermost.

```yaml theme={null}
models:
  - name: users
    meta:
      groups: ['mobile', 'engagement']
```

In the example above, the `users` table is placed under the `mobile` group, and within it, the `engagement` subgroup.

Group keys are referenced project-wide. Define their display labels and (optional) descriptions in your [`silicon.config.yml`](https://docs.meetsilicon.com/semantic-layer/silicon-config-yml#table-groups-configuration) file under `table_groups`:

```yaml theme={null}
# silicon.config.yml
table_groups:
  mobile:
    label: 'Mobile App'
    description: 'Tables related to the mobile app'
  engagement:
    label: 'Engagement'
```

If a group key is not defined in `table_groups`, the key itself is used as the label.

The tables in your sidebar will appear in the following order:

* Grouped tables appear first, with groups sorted alphabetically by label
* Ungrouped tables appear after the grouped tables, alphabetically
* Tables within each group are also ordered alphabetically

> [!NOTE]
>
> The `groups` property replaces the legacy `group_label` property. `group_label` still works for backwards compatibility but is deprecated -- migrate to `groups` for nested group support.

### SQL from

`sql_from` is a configuration option that **overrides the default dbt model relation name** when generating SQL queries in Silicon.

For example, you might use this if you want your Silicon explore to query from a specific materialized view, a different schema, or include additional SQL logic in the FROM clause while still maintaining the dbt model structure for dimensions and metrics.

```yaml dbt v1.10+ theme={null}
models:
  - name: sales
    config:
      meta:
        sql_from: my_schema.my_sales_view
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: sales
    meta:
      sql_from: my_schema.my_sales_view
```

```yaml Silicon YAML theme={null}
type: model
name: sales

sql_from: my_schema.my_sales_view
```

### SQL filter (row-level security)

`sql_filter` adds a filter to the table that cannot be removed in Silicon. It is automatically added to the compiled SQL when running queries.

For example:

```yaml dbt v1.10+ theme={null}
models:
  - name: sales
    config:
      meta:
        sql_filter: ${TABLE}.sales_region = 'EMEA'
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: sales
    meta:
      sql_filter: ${TABLE}.sales_region = 'EMEA'
```

```yaml Silicon YAML theme={null}
type: model
name: sales

sql_filter: ${TABLE}.sales_region = 'EMEA'
```

Any queries that I run using the `Sales` table in Silicon will always have a filter for `sales_region = 'EMEA'` in their compiled SQL

```yaml theme={null}
select [...]
from silicon.prod.sales
where sales_region = 'EMEA'
```

##### Row-level security using user attributes

Using `sql_filter` with [user attributes](https://docs.meetsilicon.com/workspace-admin/user-attributes.md) allows you to set up [row-level security in your tables](https://docs.meetsilicon.com/workspace-admin/user-attributes.md#row-filtering-with-sql%5Ffilter). You can reference user attributes in your `sql_filter` using `${silicon.attributes.my_attribute_name}`

For example:

```yaml dbt v1.10+ theme={null}
models:
  - name: sales
    config:
      meta:
        sql_filter: ${TABLE}.sales_region IN (${silicon.attributes.sales_region})
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: sales
    meta:
      sql_filter: ${TABLE}.sales_region IN (${silicon.attributes.sales_region})
```

```yaml Silicon YAML theme={null}
type: model
name: sales

sql_filter: ${TABLE}.sales_region IN (${silicon.attributes.sales_region})
```

##### `sql_filter` will only be applied when querying tables directly.

For example:

* Table A is joined to Table B
* Table B has a `sql_filter` applied to it
* A user queries Table A and adds a field from the joined table (Table B) to their query
* the `sql_filter` from Table B will **not** be applied to the query (you would need to add this as a `sql_filter` to Table A directly for it to apply)

##### If you reference a dimension from a joined table in your `sql_filter`, the referenced table will always be joined in your queries.

For example:

* You have Table A which is joined to Table B
* In Table A, you've added a `sql_filter: ${TABLE}.sales_region = 'EMEA' OR ${table_b}.sales_region IS NULL`
* Table B will always be joined to Table A in your queries (even if there are no fields from Table B selected in your results table)

### Required attributes

Silicon can use [user attributes](https://docs.meetsilicon.com/workspace-admin/user-attributes.md) to limit some tables to some users.

In the example below, only users with `is_admin` attribute `true` can use the `payments` table. Users without access to this table will not see it on the `tables page` or the `explore page` when joined to other tables.

```yaml dbt v1.10+ theme={null}
models:
  - name: payments
    config:
      meta:
        required_attributes:
          is_admin: "true"
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: payments
    meta:
      required_attributes:
        is_admin: "true"
```

```yaml Silicon YAML theme={null}
type: model
name: payments

required_attributes:
  is_admin: "true"
```

If a user without access to this table runs a query that contains this table, they will get a `Forbidden` error.

### Any attributes

While `required_attributes` uses AND logic (all conditions must match), `any_attributes` uses OR logic -- a user only needs to match **at least one** condition.

```yaml dbt v1.10+ theme={null}
models:
  - name: payments
    config:
      meta:
        any_attributes:
          department: ["sales", "finance"]
          role: "analyst"
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: payments
    meta:
      any_attributes:
        department: ["sales", "finance"]
        role: "analyst"
```

```yaml Silicon YAML theme={null}
type: model
name: payments

any_attributes:
  department: ["sales", "finance"]
  role: "analyst"
```

You can combine `required_attributes` and `any_attributes` on the same table. When both are set, both checks must pass. See [user attributes](https://docs.meetsilicon.com/workspace-admin/user-attributes.md#combining-required_attributes-and-any_attributes) for details.

## Defining primary keys

You can specify a primary key for your model to uniquely identify each row. This is important for tables as it helps Silicon understand the relationships between tables and prevent data duplication, especially when dealing with SQL fanouts in joins.

The primary key can be defined in two ways:

### Single column primary key

If your table has a single column that uniquely identifies each row, you can define it as a string:

```yaml dbt v1.10+ theme={null}
models:
  - name: users
    config:
      meta:
        primary_key: user_id
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: users
    meta:
      primary_key: user_id
```

```yaml Silicon YAML theme={null}
type: model
name: users

primary_key: user_id
```

### Complex primary key

If your table requires multiple columns to uniquely identify each row, you can define the primary key as an array of strings:

```yaml dbt v1.10+ theme={null}
models:
  - name: order_items
    config:
      meta:
        primary_key: [order_id, item_id]
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: order_items
    meta:
      primary_key: [order_id, item_id]
```

```yaml Silicon YAML theme={null}
type: model
name: order_items

primary_key: [order_id, item_id]
```

Using a properly defined primary key helps Silicon optimize queries and provide accurate results when working with joined tables. It's especially important for preventing metric inflation in SQL joins where duplicate rows can lead to incorrect aggregations.

## Default show underlying values

You can set a default `show_underlying_values` configuration at the model level that applies to all metrics in that model. This is useful when you want consistent underlying data visibility across all metrics without repeating the same configuration for each metric.

Individual metrics can override the model-level default by specifying their own `show_underlying_values`.

```yaml dbt v1.10+ theme={null}
models:
  - name: payments
    config:
      meta:
        default_show_underlying_values:
          - orders.customer_id
          - unique_payment_count
        metrics:
          total_revenue:
            type: sum
            sql: ${TABLE}.revenue
            # Uses the model default: orders.customer_id, unique_payment_count
          average_revenue:
            type: average
            sql: ${TABLE}.revenue
            show_underlying_values:
              - custom_field  # Overrides the model default
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: payments
    meta:
      default_show_underlying_values:
        - orders.customer_id
        - unique_payment_count
      metrics:
        total_revenue:
          type: sum
          sql: ${TABLE}.revenue
          # Uses the model default: orders.customer_id, unique_payment_count
        average_revenue:
          type: average
          sql: ${TABLE}.revenue
          show_underlying_values:
            - custom_field  # Overrides the model default
```

```yaml Silicon YAML theme={null}
type: model
name: payments

default_show_underlying_values:
  - orders.customer_id
  - unique_payment_count

metrics:
  total_revenue:
    type: sum
    sql: ${TABLE}.revenue
    # Uses the model default: orders.customer_id, unique_payment_count
  average_revenue:
    type: average
    sql: ${TABLE}.revenue
    show_underlying_values:
      - custom_field  # Overrides the model default
```

The list of fields must be dimension names (or metrics if you'd like to include them) from the base table or from any joined tables. To reference a field from a joined table, prefix the field name with the joined table name, like this: `my_joined_table_name.my_dimension`.

The order that the fields are listed in `default_show_underlying_values` is the order that they'll appear in on the "View underlying data" table.

## Default filters

Use `default_filters` to define filters on Dimensions that will be applied when no other user-defined filter on those Dimensions exists. Default filters will apply to tables on load and can be populated with a pre-determined value. Use them to suggest to users the kind of filters they might want to consider, or provide a default filtered view of a table that can be changed if needed.

An optional `required` flag can be added, and if this flag is set to `required: true`, the filter for this field cannot be removed from the UI but users can still modify the operator and value to adjust how this filter is applied to the data. This ensures the filter is always applied in some form, while giving users flexibility to change the date range or other values. This can be particularly useful if you have a large table and want to force users to filter on a partitioned date.

In contrast, when `required: false` (or omitted), the filter is pre-populated but fully editable -- users can change the field, operator, value, or remove it entirely.

`default_filters` and `required_filters` can only target **dimensions** (including visible `additional_dimensions`). Hidden dimensions (`hidden: true`) are not valid targets and will fail compilation.

Below you can see there is a default filter with the optional required flag, that will have show the last 14 days of data by default.

```yaml dbt v1.10+ theme={null}
models:
  - name: orders
    config:
      meta:
        default_filters:
          - date: 'inThePast 14 days'
		  required: true
    columns:
      - name: date
        description: 'Order date'
        config:
          meta:
            dimension:
              type: date
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: orders
    meta:
      default_filters:
        - date: 'inThePast 14 days'
		  required: true
    columns:
      - name: date
        description: 'Order date'
        meta:
          dimension:
            type: date
```

```yaml Silicon YAML theme={null}
type: model
name: orders

default_filters:
  - date: 'inThePast 14 days'
    required: true

dimensions:
  - name: date
    description: 'Order date'
    type: date
```

> [!NOTE]
>
> Note: Required filters are not a security feature. For secure data access control, use [user attributes](https://docs.meetsilicon.com/workspace-admin/user-attributes.md).

### If you have many filters in your list, they will be joined using `AND`

```yaml dbt v1.10+ theme={null}
  - name: orders
    config:
      meta:
        default_filters:
          - date: 'inThePast 14 days'
          - status: "completed"
    columns:
      - name: date
        description: 'Order date'
        config:
          meta:
            dimension:
              type: date
      - name: status
        description: 'Order status - completed, pending, cancelled'
        config:
          meta:
            dimension:
              type: string
```

```yaml dbt v1.9 and earlier theme={null}
  - name: orders
    meta:
      default_filters:
        - date: 'inThePast 14 days'
        - status: "completed"
    columns:
      - name: date
        description: 'Order date'
        meta:
          dimension:
            type: date
      - name: status
        description: 'Order status - completed, pending, cancelled'
        meta:
          dimension:
            type: string
```

```yaml Silicon YAML theme={null}
type: model
name: orders

default_filters:
  - date: 'inThePast 14 days'
  - status: "completed"

dimensions:
  - name: date
    description: 'Order date'
    type: date
  - name: status
    description: 'Order status - completed, pending, cancelled'
    type: string
```

In the example above, the `orders` table will have a default filter of `date` in the past 14 days **and** `status` completed. Both can be removed by the user, as the `required` flag is not present.

Note that we do also support a *legacy* structure for defining required filters, see below:

```yaml dbt v1.10+ theme={null}
models:
  - name: orders
    config:
      meta:
        required_filters:
          - date: 'inThePast 14 days'
    columns:
      - name: date
        description: 'Order date'
        config:
          meta:
            dimension:
              type: date
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: orders
    meta:
      required_filters:
        - date: 'inThePast 14 days'
    columns:
      - name: date
        description: 'Order date'
        meta:
          dimension:
            type: date
```

```yaml Silicon YAML theme={null}
type: model
name: orders

required_filters:
  - date: 'inThePast 14 days'

dimensions:
  - name: date
    description: 'Order date'
    type: date
```

### Available filter types

| Operator | Description | Example (as code) | Supported Types |
| :- | :- | :- | :- |
| is | Value is equal to | `user_name: "katie"` | String, Number, Date |
| is not | Value is not equal to | `user_name: "!katie"` | String, Number, Date |
| between | Value is between two values (inclusive) | `age: "between 18 and 65"` | Number, Date |
| | | `order_date: "between 2024-01-01 and 2024-12-31"` | Number, Date |
| contains | String contains value | `user_name: "%katie%"` | String |
| does not contain | String does not contain value | `user_name: "!%katie%"` | String |
| starts with | String starts with value | `user_name: "katie%"` | String |
| ends with | String ends with value | `user_name: "%katie"` | String |
| is greater than | Number is greater than value | `num_orders: "> 4"` | Number |
| is greater than or equal to | Number is greater than or equal to value | `num_orders: ">= 4"` | Number |
| is less than | Number is less than value | `num_orders: "< 4"` | Number |
| is less than or equal to | Number is less than or equal to value | `num_orders: "<= 4"` | Number |
| in the past | Date is before x (days / months / years) | `date: "inThePast 14 days"` | Date |
| in the next | Date is after x (days / months / years) | `date: "inTheNext 30 days"` | Date |
| in the current | Date is in the current (day / week / month / quarter / year) | `date: "inTheCurrent day"` | Date |
| not in the current | Date is not in the current (day / week / month / quarter / year) | `date: "notInTheCurrent week"` | Date |
| is null | Value is NULL | `status: "null"` | All |
| is not null | Value is not NULL | `status: "!null"` | All |
| is empty | Value is empty string | `notes: "empty"` | String |
| is not empty | Value is not empty string | `notes: "!empty"` | String |
| is \[boolean] | Boolean value is true | `is_complete: "true"` | Boolean |
| is not \[boolean] | Boolean value is false or null | `is_complete: "!true"` | Boolean |
| in list | Value is in a list of values | `status: ["active", "pending", "approved"]` | String, Number |

### Filter examples

**Between operator (numeric):**

```yaml theme={null}
default_filters:
  - age: 'between 18 and 65'
  - price: 'between 0.5 and 99.9'
  - temperature: 'between -10 and 10'
```

**Between operator (dates):**

```yaml theme={null}
default_filters:
  - order_date: 'between 2024-01-01 and 2024-12-31'
  - created_at: 'between 2024-01-01T00:00:00 and 2024-12-31T23:59:59'
```

**Multiple values (list):**

Use an array to filter by multiple values. This generates a SQL `IN` clause, e.g. `WHERE status IN ('active', 'pending', 'approved')`.

```yaml theme={null}
default_filters:
  - status:
      - 'active'
      - 'pending'
      - 'approved'
  - country:
      - 'US'
      - 'CA'
      - 'UK'
```

**Pattern matching:**

```yaml theme={null}
default_filters:
  - product_name: '%shirt%'        # Contains "shirt"
  - email: 'admin%'                # Starts with "admin"
  - domain: '%@gmail.com'          # Ends with "@gmail.com"
  - product_name: '!%test%'        # Does not contain "test"
```

**Date intervals:**

```yaml theme={null}
default_filters:
  - created_date: 'inThePast 7 days'
  - expiry_date: 'inTheNext 30 days'
  - signup_date: 'inThePast 1 years'
```

Available intervals: `milliseconds`, `seconds`, `minutes`, `hours`, `days`, `weeks`, `months`, `years`

**Current time period (no value needed):**

Use `inTheCurrent` / `notInTheCurrent` to filter dynamically to the current time period. These operators take no number -- just a unit of time (singular or plural).

```yaml theme={null}
default_filters:
  - order_date: 'inTheCurrent day'
  - order_date: 'notInTheCurrent month'
```

Available units: `day`, `week`, `month`, `quarter`, `year`

**Complex example with multiple filters:**

```yaml dbt v1.10+ theme={null}
models:
  - name: orders
    config:
      meta:
        default_filters:
          - status:
              - 'completed'
              - 'shipped'
          - order_date: 'between 2024-01-01 and 2024-12-31'
          - revenue: '>= 100'
          - country: '!test'
          - customer_email: '!%@test.com%'
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: orders
    meta:
      default_filters:
        - status:
            - 'completed'
            - 'shipped'
        - order_date: 'between 2024-01-01 and 2024-12-31'
        - revenue: '>= 100'
        - country: '!test'
        - customer_email: '!%@test.com%'
```

```yaml Silicon YAML theme={null}
type: model
name: orders

default_filters:
  - status:
      - 'completed'
      - 'shipped'
  - order_date: 'between 2024-01-01 and 2024-12-31'
  - revenue: '>= 100'
  - country: '!test'
  - customer_email: '!%@test.com%'
```

### Filter notes

* **Case insensitivity**: Keywords like `between`, `AND`, `null`, `empty` are case-insensitive
* **Quotes**: Use quotes for strings with spaces or special characters
* **Escaping**: Use `^` to escape special characters (`%`, `_`, `,`, `!`, `^`)
* **AND logic**: Multiple filters are automatically joined with AND
* **Priority**: Default filters only apply when no user-specified filter exists for that dimension
* **Supported fields**: `default_filters` and `required_filters` apply to dimensions only (not metrics)
* **Hidden fields**: Hidden dimensions (`hidden: true`) cannot be used in `default_filters`/`required_filters`

## Case sensitive

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 string filter operators: `equals`, `not equals`, `starts with`, `ends with`, `includes`, and `doesn't include`.

```yaml dbt v1.10+ theme={null}
models:
  - name: customers
    config:
      meta:
        case_sensitive: false
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: customers
    meta:
      case_sensitive: false
```

```yaml Silicon YAML theme={null}
type: model
name: customers

case_sensitive: false
```

With `case_sensitive: false`, filtering for "john" on any string dimension would match "John", "JOHN", "john", etc.

> [!NOTE]
>
> Table-level `case_sensitive` settings override the project-level default. Dimension-level settings override both. See [Dimensions reference](https://docs.meetsilicon.com/semantic-layer/dimensions.md#case-sensitive) for dimension-level configuration and [silicon.config.yml reference](https://docs.meetsilicon.com/semantic-layer/silicon-config-yml.md#defaults-configuration) for project-level defaults.

## Parameters configuration

Model-level parameters are defined under the model's `meta.parameters` key (in Silicon YAML, the top-level `parameters` key). They are scoped to the model where you define them and use the same property schema as project-wide parameters -- reference them in the model's SQL properties with the model name included, `${silicon.parameters.model_name.parameter_name}` (or the shorter `${ld.parameters.model_name.parameter_name}`).

See the [Parameters reference](https://docs.meetsilicon.com/semantic-layer/parameters.md#parameters-configuration) for the full property schema, and the [Parameters guide](https://docs.meetsilicon.com/semantic-layer/parameters.md) for syntax and examples, including referencing model-level parameters from joined tables.

## Explores

You can define multiple table explores from a single table using the `explores` config. This will allow you to list the same dbt model multiple times in the list of Tables in Silicon. You can use it to show different versions of a table, join different tables to the base table, customize table visibility, etc.

Below is an advanced example of using Explores. This will result in three total tables using the `deals` model at the base.

* **Deals** will not have any joins or limitations
* **Deals w/Accounts** will join to the `accounts` table and show all Accounts fields, but only people with the `is_exec` user attribute can see it
* **Deals w/Accounts (no Names)** will join to the `accounts` table and only show Industry and Segment dimensions, it has no access restrictions

```yaml dbt v1.10+ theme={null}
models:
- name: deals
  config:
    meta:
      primary_key: deal_id
      explores:
        deals_accounts:
          required_attributes:
            is_exec: "true"
          label: 'Deals w/Accounts'
          description: The deals table with the Accounts table details included
          joins:
          - join: accounts
            relationship: many-to-one
            sql_on: ${deals.account_id} = ${accounts.account_id}
        deals_accounts_no_names:
          label: 'Deals w/Accounts (no Names)'
          description: The deals table with the Accounts table details included
          joins:
          - join: accounts
            relationship: many-to-one
            sql_on: ${deals.account_id} = ${accounts.account_id}
            fields: [industry, segment, unique_accounts, unique_smb_accounts, unique_midmarket_accounts, unique_enterprise_accounts]
```

```yaml dbt v1.9 and earlier theme={null}
models:
- name: deals
  meta:
    primary_key: deal_id
    explores:
      deals_accounts:
        required_attributes:
          is_exec: "true"
        label: 'Deals w/Accounts'
        description: The deals table with the Accounts table details included
        joins:
        - join: accounts
          relationship: many-to-one
          sql_on: ${deals.account_id} = ${accounts.account_id}
      deals_accounts_no_names:
        label: 'Deals w/Accounts (no Names)'
        description: The deals table with the Accounts table details included
        joins:
        - join: accounts
          relationship: many-to-one
          sql_on: ${deals.account_id} = ${accounts.account_id}
          fields: [industry, segment, unique_accounts, unique_smb_accounts, unique_midmarket_accounts, unique_enterprise_accounts]
```

```yaml Silicon YAML theme={null}
type: model
name: deals

primary_key: deal_id
explores:
  deals_accounts:
    required_attributes:
      is_exec: "true"
    label: 'Deals w/Accounts'
    description: The deals table with the Accounts table details included
    joins:
    - join: accounts
      relationship: many-to-one
      sql_on: ${deals.account_id} = ${accounts.account_id}
  deals_accounts_no_names:
    label: 'Deals w/Accounts (no Names)'
    description: The deals table with the Accounts table details included
    joins:
    - join: accounts
      relationship: many-to-one
      sql_on: ${deals.account_id} = ${accounts.account_id}
      fields: [industry, segment, unique_accounts, unique_smb_accounts, unique_midmarket_accounts, unique_enterprise_accounts]
```

All the [table configuration options](#table-configuration) can be used under the `explores` tag.

[Read this guide to learn more about explores](https://docs.meetsilicon.com/semantic-layer/explores.md)

### Hiding the base explore

By default, a model with `explores` still gets an explore of its own, so the model appears in the Tables list alongside its curated explores. If you only want to expose the curated explores, set `hidden: true` on the model. This is useful when you want to scope access to a curated explore only -- for example, giving an AI agent access to a curated explore via explore-level `tags` without also exposing the underlying model.

`hidden` only skips the model's own explore. The model is still compiled as a table, so it remains available as a join target from other tables and as the base table for its `explores` entries.

```yaml dbt v1.10+ theme={null}
models:
- name: deals
  config:
    meta:
      hidden: true
      primary_key: deal_id
      explores:
        deals_curated:
          label: 'Deals (Curated)'
          description: The curated view of the deals table
          tags: ['ai']
```

```yaml dbt v1.9 and earlier theme={null}
models:
- name: deals
  meta:
    hidden: true
    primary_key: deal_id
    explores:
      deals_curated:
        label: 'Deals (Curated)'
        description: The curated view of the deals table
        tags: ['ai']
```

```yaml Silicon YAML theme={null}
type: model
name: deals

hidden: true
primary_key: deal_id
explores:
  deals_curated:
    label: 'Deals (Curated)'
    description: The curated view of the deals table
    tags: ['ai']
```

In this example, only **Deals (Curated)** appears in Silicon -- the base **Deals** explore is not created.

After adding `hidden: true`, run a full `silicon deploy` without `--select`, or run `silicon refresh`. A deploy with `--select` never removes explores, so it leaves the previously deployed base explore in place even when the model is selected. See [Partial deploys](https://docs.meetsilicon.com/workflow/cli/reference.md#partial-deploys).

## Sets

Sometimes you may find that you're redeclaring the same set of fields for things like joins and show\_underlying\_values. In this case, you can define a `set`.  A `set` allows you to associate those fields to a single value. That reference can then be used any place you would normally define fields.

```yaml theme={null}
# Define a set
sets:
  my_set:
    fields:
      - user_id
      - user_name
      - created_at

# Referencing the set
fields: [my_set*]

# Silicon resolves to
fields: [user_id, user_name, created_at]
```

### Expand

The expand operator (ex. `my_set*`) tells Silicon to look up the set being referenced and resolve it to the associated collection of fields. When Silicon compiles your model, it will replace set reference names with the actual fields.

```yaml dbt v1.10+ theme={null}
models:
  - name: orders_model
    config:
      meta:
        sets:
          my_user_fields:
            fields:
              - user_id
              - user_name
    columns:
      - name: revenue
        config:
          meta:
            metrics:
              sum_revenue:
                type: sum
                show_underlying_values:
                  - my_user_fields* # Reference to the set we defined
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: orders_model
    meta:
      sets:
        my_user_fields:
          fields:
            - user_id
            - user_name
    columns:
      - name: revenue
        meta:
          metrics:
            sum_revenue:
              type: sum
              show_underlying_values:
                - my_user_fields* # Reference to the set we defined
```

```yaml Silicon YAML theme={null}
type: model
name: orders_model

sets:
  my_user_fields:
    fields:
      - user_id
      - user_name

dimensions:
  - name: revenue

metrics:
  sum_revenue:
    type: sum
    sql: ${TABLE}.revenue
    show_underlying_values:
      - my_user_fields* # Reference to the set we defined
```

### Exclusions

In the instance where you want to leverage some, but not all fields in a `set`, you can use the excludes operator (ex. `-field_name`). The exclusion needs to be used in conjunction with an expand operator. This tells Silicon to expand a given `set` while omitting any field name using the exclusion operator.

```yaml dbt v1.10+ theme={null}
models:
  - name: orders_model
    config:
      meta:
        sets:
          my_user_fields:
            fields:
              - user_id
              - user_name
    columns:
      - name: revenue
        config:
          meta:
            metrics:
              sum_revenue:
                type: sum
                show_underlying_values:
                  - my_user_fields*
                  - -user_id # Expand `my_user_fields` and exclude `user_id`
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: orders_model
    meta:
      sets:
        my_user_fields:
          fields:
            - user_id
            - user_name
    columns:
      - name: revenue
        meta:
          metrics:
            sum_revenue:
              type: sum
              show_underlying_values:
                - my_user_fields*
                - -user_id # Expand `my_user_fields` and exclude `user_id`
```

```yaml Silicon YAML theme={null}
type: model
name: orders_model

sets:
  my_user_fields:
    fields:
      - user_id
      - user_name

dimensions:
  - name: revenue

metrics:
  sum_revenue:
    type: sum
    sql: ${TABLE}.revenue
    show_underlying_values:
      - my_user_fields*
      - -user_id # Expand `my_user_fields` and exclude `user_id`
```

### Joins

Within a model, you may join with other model tables. The sets you define can reference those joined fields as well! Use dot notation to reference a joined table:

```yaml dbt v1.10+ theme={null}
models:
  - name: purchases
    columns: <...>
    config:
      meta:
        sets:
    	    revenue_fields:
      	  fields:
              - purchase_date
              - purchase_amount
              - user.user_name # Referencing the joined table
        joins:
          - join: user
            sql_on: ${users.user_id} = ${purchases.user_id}
            relationship: one-to-many
        metrics:
          revenue:
            type: sum
            show_underlying_values:
              - revenue_fields*
```

```yaml dbt v1.9 and earlier theme={null}
models:
  - name: purchases
    columns: <...>
    meta:
      sets:
  	    revenue_fields:
    	  fields:
            - purchase_date
            - purchase_amount
            - user.user_name # Referencing the joined table
      joins:
        - join: user
          sql_on: ${users.user_id} = ${purchases.user_id}
          relationship: one-to-many
      metrics:
        revenue:
          type: sum
          show_underlying_values:
            - revenue_fields*
```

```yaml Silicon YAML theme={null}
type: model
name: purchases

sets:
  revenue_fields:
    fields:
      - purchase_date
      - purchase_amount
      - user.user_name # Referencing the joined table

joins:
  - join: user
    sql_on: ${users.user_id} = ${purchases.user_id}
    relationship: one-to-many

metrics:
  revenue:
    type: sum
    sql: ${TABLE}.revenue
    show_underlying_values:
      - revenue_fields*
```

Remember, in order to include fields from another table in your set, you need ensure that you have joined the table the set originates from before defining the `set`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.