> 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 a transposed table

> Example Sigma code representation of a data model with a transposed table.

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, select **Transpose**.

5. Search for the table `FIVETRAN_LOG__AUDIT_TABLE` in the `APPLICATIONS.FIVETRAN_LOG` schema and select it.

6. In the **Transpose table** modal, configure the transposed table with the following settings:

   |                                     |                                                                                            |
   | :---------------------------------- | :----------------------------------------------------------------------------------------- |
   | **Type**                            | Select **Column to row**                                                                   |
   | **Columns to merge**                | Select **Write to Table Start**, **Write to Table End**, **Sync Start**, and **Sync End**. |
   | **Column label for merged columns** | Enter `Event type`.                                                                        |
   | **Column label for values**         | Enter `Event time`.                                                                        |
   | **Output columns**                  | Select **All columns**.                                                                    |

7. Select **Submit**.

   The transposed table element appears on the workbook canvas.

8. 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": "b84cd40d-fe08-4cee-8a92-e58bbffbdb54",
  "name": "transposed-table",
  "url": "https://aws-api.sigmacomputing.com/org-name/data-model/transposed-table-U1Apjrz1ZShP7lRFUpPtSV",
  "documentVersion": 2,
  "latestDocumentVersion": 2,
  "ownerId": "fOsrWKBxSMe8HqLmT0nXESkGLpkIc",
  "folderId": "fcb10706-125c-4a83-83d1-2977c8d963a0",
  "createdBy": "fOsrWKBxSMe8HqLmT0nXESkGLpkIc",
  "updatedBy": "fOsrWKBxSMe8HqLmT0nXESkGLpkIc",
  "createdAt": "2026-03-24T16:43:08.648Z",
  "updatedAt": "2026-03-24T21:22:27.148Z",
  "schemaVersion": 1,
  "pages": [
    {
      "id": "PaNW1dxyMa",
      "name": "Page 1",
      "elements": [
        {
          "id": "sUCcKUdZlu",
          "kind": "table",
          "source": {
            "kind": "transpose",
            "source": {
              "connectionId": "9ad28df9-5f5f-4bae-8985-bb12d25829de",
              "kind": "warehouse-table",
              "path": [
                "APPLICATIONS",
                "FIVETRAN_LOG",
                "FIVETRAN_LOG__AUDIT_TABLE"
              ]
            },
            "direction": "column-to-row",
            "columnsToMerge": [
              "Write to Table Start",
              "Write to Table End",
              "Sync Start",
              "Sync End"
            ],
            "columnLabelForMergedColumns": "Event type",
            "columnLabelForValues": "Event time"
          },
          "columns": [
            {
              "id": "sO8pgwvtr3",
              "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Connector Id]"
            },
            {
              "id": "4gU0meYPUw",
              "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Connector Name]"
            },
            {
              "id": "cPz77SFkjx",
              "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Table Name]"
            },
            {
              "id": "vqBhFyOdEN",
              "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Destination Id]"
            },
            {
              "id": "ZXhUSZzWdp",
              "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Destination Name]"
            },
            {
              "id": "bpeSWS9lXt",
              "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Sum Rows Replaced or Inserted]"
            },
            {
              "id": "sNy2y3US1A",
              "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Sum Rows Updated]"
            },
            {
              "id": "j08SK8G40M",
              "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Sum Rows Deleted]"
            },
            {
              "id": "DTHceygwGz",
              "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Unique Table Sync Key]"
            },
            {
              "id": "BJ9ACxFSS7",
              "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Event type]"
            },
            {
              "id": "sgp2iZSpPf",
              "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Event time]"
            }
          ],
          "order": [
            "sO8pgwvtr3",
            "4gU0meYPUw",
            "cPz77SFkjx",
            "vqBhFyOdEN",
            "ZXhUSZzWdp",
            "bpeSWS9lXt",
            "sNy2y3US1A",
            "j08SK8G40M",
            "DTHceygwGz",
            "BJ9ACxFSS7",
            "sgp2iZSpPf"
          ]
        }
      ]
    }
  ]
}
```

## Representing transposed tables

In this representation, the transposed table is represented by this object in the `elements` array of the data model:

#### Transposed table representation

```json
...
{
  "id": "sUCcKUdZlu",
  "kind": "table",
  "source": {
    "kind": "transpose",
    "source": {
      "connectionId": "9ad28df9-5f5f-4bae-8985-bb12d25829de",
      "kind": "warehouse-table",
      "path": [
        "APPLICATIONS",
        "FIVETRAN_LOG",
        "FIVETRAN_LOG__AUDIT_TABLE"
      ]
    },
    "direction": "column-to-row",
    "columnsToMerge": [
      "Write to Table Start",
      "Write to Table End",
      "Sync Start",
      "Sync End"
    ],
    "columnLabelForMergedColumns": "Event type",
    "columnLabelForValues": "Event time"
  },
  "columns": [
    {
      "id": "sO8pgwvtr3",
      "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Connector Id]"
    },
    {
      "id": "4gU0meYPUw",
      "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Connector Name]"
    },
    {
      "id": "cPz77SFkjx",
      "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Table Name]"
    },
    {
      "id": "vqBhFyOdEN",
      "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Destination Id]"
    },
    {
      "id": "ZXhUSZzWdp",
      "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Destination Name]"
    },
    {
      "id": "bpeSWS9lXt",
      "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Sum Rows Replaced or Inserted]"
    },
    {
      "id": "sNy2y3US1A",
      "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Sum Rows Updated]"
    },
    {
      "id": "j08SK8G40M",
      "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Sum Rows Deleted]"
    },
    {
      "id": "DTHceygwGz",
      "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Unique Table Sync Key]"
    },
    {
      "id": "BJ9ACxFSS7",
      "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Event type]"
    },
    {
      "id": "sgp2iZSpPf",
      "formula": "[Transpose of FIVETRAN_LOG__AUDIT_TABLE/Event time]"
    }
  ],
  "order": [
    "sO8pgwvtr3",
    "4gU0meYPUw",
    "cPz77SFkjx",
    "vqBhFyOdEN",
    "ZXhUSZzWdp",
    "bpeSWS9lXt",
    "sNy2y3US1A",
    "j08SK8G40M",
    "DTHceygwGz",
    "BJ9ACxFSS7",
    "sgp2iZSpPf"
  ]
}
...
```