> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Example representation: Data model with filters

> Example Sigma code representation of a data model with filters.

This is an example representation of a data model, created using the [get a data model representation](/reference/getdatamodelspec) endpoint. Representations like this one can be used to create a data model from code using the [create a data model from a representation](/reference/createdatamodelspec) endpoint. Each page in this example library includes the code representation of the data model and step-by-step instructions to create it in the Sigma UI.

Consult this example and others in the [Data model representation example library](/docs/data-model-representation-example-library) to:

* Troubleshoot the formatting of a particular feature in code representation
* Relate a feature from the Sigma UI to its representation in code
* Provide context to AI tools used to create data models from code

This example representation cannot be used as-is. All identifying details, such as IDs, names, and URLs, have been replaced with randomized ID values or generic substitutions. The format of these contents, like the length of ID values, is preserved for demonstrative purposes. However, this representation cannot be directly used without modification to the base URL, connection details, and more. For more information, see [Create and manage data models from code](/docs/manage-data-models-as-code).

## System and user requirements

To complete the steps in this example, you must meet the user requirements listed below for creating the data model in the UI and creating it from code.

The ability to create this data model in the Sigma UI requires the following:

* You must be assigned an [account type](/docs/account-type-and-license-overview) with the **Create, edit, and publish data models** permissions enabled.
* You must have access to a connection to a data platform.

The ability to create a data model from code requires the following:

* You must be assigned the **Admin** [account type](/docs/account-type-and-license-overview).
* You must have developer credentials for the Sigma API. For more information, see [Get started with the Sigma REST API](/reference/get-started-sigma-api).

This example uses a table from the [Sigma Sample Connection](/docs/sigmas-sample-connection). Your organization might have disabled access to the Sigma sample connection. If so, you can contact an admin to enable it, or use a table from another connection to follow along with this example.

## Create the example data model in the Sigma UI

To create this data model in the Sigma UI:

1. Go to the **Home** page.

2. Select <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/button-add.svg" alt="" /> **Create New** > **Data model**.

   A new data model opens.

3. From the **Add element** bar, select **Data** > **Table**.

4. In the **Select source** modal, search for the table `PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA` in the `EXAMPLES.PLUGS_ELECTRONICS` schema.

5. Select the table to add it to the data model.

   The table appears in the data model.

6. In the `[Quantity]` column, select the down arrow <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/caret.svg" alt="" /> to open the column menu, and then select **Filter**.

7. Configure the new filter with a minimum value of `4` and a maximum value of `10`.

8. In the `[Product Type]` column, select the down arrow <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/caret.svg" alt="" /> to open the column menu, and then select **Filter**.

9. Configure the new filter to only show rows with the value `Music`.

10. In the `[Product Name]` column, select the down arrow <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/caret.svg" alt="" /> to open the column menu, and then select **Filter**.

11. Select <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/ellipsis-horizontal.svg" alt="" /> **More options** > **Change filter type** and select **Text match**.

12. Configure the new filter with the **Contains** comparison operator, and enter the text value `Geek Squad Certified`.

13. Select **Publish**.

## Get a JSON representation of this data model

To get a JSON representation of this data model, follow the steps in [Get the code representation of a data model](/docs/get-the-code-representation-of-a-data-model).

The JSON representation of this data model appears like the following:

#### JSON representation

```json
{
  "dataModelId": "783e1f45-232e-4517-8ab0-7ade98e2976e",
  "name": "filters",
  "url": "https://aws-api.sigmacomputing.com/org-name/data-model/filters-7jROCnEwXxxgCiPhiWsZt0",
  "documentVersion": 2,
  "latestDocumentVersion": 2,
  "ownerId": "d4nQvGNUuQooK1njlat7QrJYgMUoo",
  "folderId": "8d1beeb0-b41d-48fc-9913-18b442c99562",
  "createdBy": "d4nQvGNUuQooK1njlat7QrJYgMUoo",
  "updatedBy": "d4nQvGNUuQooK1njlat7QrJYgMUoo",
  "createdAt": "2026-04-01T19:18:23.694Z",
  "updatedAt": "2026-04-01T19:19:17.913Z",
  "schemaVersion": 1,
  "pages": [
    {
      "id": "6OZtvsushK",
      "name": "Page 1",
      "elements": [
        {
          "id": "IkoY1seJXG",
          "kind": "table",
          "source": {
            "connectionId": "b577364f-7b68-445f-9a7e-7c099e6beac4",
            "kind": "warehouse-table",
            "path": [
              "EXAMPLES",
              "PLUGS_ELECTRONICS",
              "PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA"
            ]
          },
          "columns": [
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/ORDER_NUMBER",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Order Number]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/DATE",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Date]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/SKU_NUMBER",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Sku Number]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/QUANTITY",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Quantity]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/COST",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Cost]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/PRICE",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Price]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_TYPE",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Product Type]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_FAMILY",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Product Family]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_LINE",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Product Line]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/BRAND",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Brand]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_NAME",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Product Name]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/STORE_NAME",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Store Name]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/STORE_KEY",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Store Key]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/STORE_REGION",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Store Region]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/STORE_STATE",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Store State]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/STORE_CITY",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Store City]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/STORE_ZIP_CODE",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Store Zip Code]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/STORE_LATITUDE",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Store Latitude]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/STORE_LONGITUDE",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Store Longitude]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/CUST_KEY",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Cust Key]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/CUSTOMER_NAME",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Customer Name]"
            },
            {
              "id": "inode-PSC2jczeKrSIHptL5yHlYw/CUST_JSON",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Cust Json]"
            }
          ],
          "filters": [
            {
              "id": "EJ6f0UA3DE",
              "columnId": "inode-PSC2jczeKrSIHptL5yHlYw/QUANTITY",
              "kind": "number-range",
              "includeNulls": "when-no-value-is-selected",
              "min": 4,
              "max": 10
            },
            {
              "id": "aMohKq9V3s",
              "columnId": "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_TYPE",
              "kind": "list",
              "mode": "include",
              "values": [
                "Music"
              ]
            },
            {
              "id": "O8sbuZBeSI",
              "columnId": "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_NAME",
              "kind": "text-match",
              "mode": "contains",
              "value": "Geek Squad Certified",
              "case": "insensitive",
              "includeNulls": "when-no-value-is-selected"
            }
          ],
          "order": [
            "inode-PSC2jczeKrSIHptL5yHlYw/ORDER_NUMBER",
            "inode-PSC2jczeKrSIHptL5yHlYw/DATE",
            "inode-PSC2jczeKrSIHptL5yHlYw/SKU_NUMBER",
            "inode-PSC2jczeKrSIHptL5yHlYw/QUANTITY",
            "inode-PSC2jczeKrSIHptL5yHlYw/COST",
            "inode-PSC2jczeKrSIHptL5yHlYw/PRICE",
            "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_TYPE",
            "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_FAMILY",
            "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_LINE",
            "inode-PSC2jczeKrSIHptL5yHlYw/BRAND",
            "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_NAME",
            "inode-PSC2jczeKrSIHptL5yHlYw/STORE_NAME",
            "inode-PSC2jczeKrSIHptL5yHlYw/STORE_KEY",
            "inode-PSC2jczeKrSIHptL5yHlYw/STORE_REGION",
            "inode-PSC2jczeKrSIHptL5yHlYw/STORE_STATE",
            "inode-PSC2jczeKrSIHptL5yHlYw/STORE_CITY",
            "inode-PSC2jczeKrSIHptL5yHlYw/STORE_ZIP_CODE",
            "inode-PSC2jczeKrSIHptL5yHlYw/STORE_LATITUDE",
            "inode-PSC2jczeKrSIHptL5yHlYw/STORE_LONGITUDE",
            "inode-PSC2jczeKrSIHptL5yHlYw/CUST_KEY",
            "inode-PSC2jczeKrSIHptL5yHlYw/CUSTOMER_NAME",
            "inode-PSC2jczeKrSIHptL5yHlYw/CUST_JSON"
          ]
        }
      ]
    }
  ]
}
```

## Representing filters

In this representation, the filters are represented by the `filters` array for the table element:

#### Filters representation

```json
...
{
  "id": "EJ6f0UA3DE",
  "columnId": "inode-PSC2jczeKrSIHptL5yHlYw/QUANTITY",
  "kind": "number-range",
  "includeNulls": "when-no-value-is-selected",
  "min": 4,
  "max": 10
},
{
  "id": "aMohKq9V3s",
  "columnId": "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_TYPE",
  "kind": "list",
  "mode": "include",
  "values": [
    "Music"
  ]
},
{
  "id": "O8sbuZBeSI",
  "columnId": "inode-PSC2jczeKrSIHptL5yHlYw/PRODUCT_NAME",
  "kind": "text-match",
  "mode": "contains",
  "value": "Geek Squad Certified",
  "case": "insensitive",
  "includeNulls": "when-no-value-is-selected"
}
...
```

To learn more about filter types and their representations, consult the interactive **Body Params** section in [Create a data model from a code representation](/reference/create-data-model-spec). There, you can craft an example with one or more filters and see its representation.