> 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: Workbook with a pie chart (Beta)

This documentation describes one or more private beta features that are in development. Beta features are subject to quick, iterative changes; therefore the current user experience in the Sigma service can differ from the information provided in this page.

This page should not be considered official published documentation until Sigma removes this notice and the beta flag on the corresponding feature(s) in the Sigma service. For the full beta feature disclaimer, see [Beta features](/docs/sigma-product-releases#beta-features).

If you are interested in joining a limited test group and enabling this feature in your Sigma organization, [contact Support](/docs/sigma-support) or reach out to your Account Executive.

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

Consult this example and others in the [Workbook representation example library](/docs/workbook-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 workbooks 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 workbooks from code](/docs/manage-workbooks-as-code).

## System and user requirements

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

The ability to create this workbook 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 workbooks** permission enabled.
* You must have access to a connection to a data platform.

The ability to create a workbook from code requires the following:

* You must be assigned an [account type](/docs/account-type-and-license-overview) with the **Create, edit, and publish workbooks** permission enabled.
* 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 workbook in the Sigma UI

This example shows a simple workbook with a single table element, sourced from a warehouse table, and a pie chart.

To create this workbook 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** > **Workbook**.

   A new workbook opens.

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

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

5. Select the table to add it to the workbook.

   The table appears in the workbook.

6. Select <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/add-dependent.svg" alt="" /> **Add child element** > **Chart**.

   A new bar chart element appears on the workbook canvas.

7. In the editor panel, select **Properties** and configure the chart with the following settings:

   | Option         | Setting             |
   | :------------- | :------------------ |
   | **Chart type** | **Pie**             |
   | **Color**      | *Subscription Type* |
   | **Value**      | *Count of Id*       |

8. In the document header, select **Save as**.

9. Enter a name for the workbook, such as `pie-chart`.

10. Select **Save**.

## Get a code representation of this workbook

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

The code representation of this workbook appears like the following:

```yaml
workbookId: 87cbdabd-3430-4fde-a759-d3d81c99a062
name: pie-chart
url: https://aws-api.sigmacomputing.com/org-name/workbook/pie-chart-KpEJAbcFw6hRJOa0TwySf2
documentVersion: 2
latestDocumentVersion: 2
ownerId: Ipb0LILcSmxdd6uZFfy2EJLR6N2nr
folderId: 2cfd0815-2749-49b4-9a07-46684d13e7d0
createdBy: Ipb0LILcSmxdd6uZFfy2EJLR6N2nr
updatedBy: Ipb0LILcSmxdd6uZFfy2EJLR6N2nr
createdAt: '2026-04-20T20:09:55.393Z'
updatedAt: '2026-04-21T14:49:54.416Z'
schemaVersion: 1
pages:
  - id: cKsWSwsqeo
    name: Page 1
    elements:
      - id: SonP8LBNkD
        kind: table
        source:
          connectionId: d6bfeea1-5da2-458c-9bcf-ec9400d24ceb
          kind: warehouse-table
          path:
            - FUN
            - BIKES
            - TRIP
        columns:
          - id: pKyVLYEJXN
            formula: '[TRIP/Id]'
          - id: GtrPDvF1jK
            formula: '[TRIP/Duration]'
          - id: paIMp7LOyS
            formula: '[TRIP/Start Date]'
          - id: uzU0RLNSBN
            formula: '[TRIP/Start Station Name]'
          - id: LaZnoJBlqB
            formula: '[TRIP/Start Station Id]'
          - id: FOd58iNdfI
            formula: '[TRIP/End Date]'
          - id: Vgkc6MTmhX
            formula: '[TRIP/End Station Name]'
          - id: rm7lccCeIA
            formula: '[TRIP/End Station Id]'
          - id: NDhSfTxUVp
            formula: '[TRIP/Bike Id]'
          - id: 5L5Hy8phqU
            formula: '[TRIP/Subscription Type]'
          - id: ulSKMp0fID
            formula: '[TRIP/Zip Code]'
        order:
          - pKyVLYEJXN
          - GtrPDvF1jK
          - paIMp7LOyS
          - uzU0RLNSBN
          - LaZnoJBlqB
          - FOd58iNdfI
          - Vgkc6MTmhX
          - rm7lccCeIA
          - NDhSfTxUVp
          - 5L5Hy8phqU
          - ulSKMp0fID
      - id: 6SzgNldqOM
        kind: pie-chart
        source:
          elementId: SonP8LBNkD
          kind: table
        columns:
          - id: GFDmGEXy2n
            formula: '[TRIP/Subscription Type]'
          - id: 'Qtbl8lge9J'
            formula: Count([Id])
          - id: d61wawsb5y
            formula: '[TRIP/Id]'
          - id: FID4i5yQS9
            formula: '[TRIP/Duration]'
          - id: GAMFr8Oz65
            formula: '[TRIP/Start Date]'
          - id: kOmKh2jZVT
            formula: '[TRIP/Start Station Name]'
          - id: iUXx39w9AR
            formula: '[TRIP/Start Station Id]'
          - id: CGYSBA5PSg
            formula: '[TRIP/End Date]'
          - id: RxYSYJrAB6
            formula: '[TRIP/End Station Name]'
          - id: t9edEVxCc5
            formula: '[TRIP/End Station Id]'
          - id: 2ZDGxCRQRX
            formula: '[TRIP/Bike Id]'
          - id: gYBhUIwQyJ
            formula: '[TRIP/Zip Code]'
        color:
          id: GFDmGEXy2n
        value:
          id: 'Qtbl8lge9J'
layout: |
  <?xml version="1.0" encoding="utf-8"?>
  <Page type="grid" gridTemplateColumns="repeat(24, 1fr)" gridTemplateRows="auto" id="cKsWSwsqeo">
    <LayoutElement elementId="SonP8LBNkD" gridColumn="1 / 25" gridRow="1 / 21"/>
    <LayoutElement elementId="6SzgNldqOM" gridColumn="1 / 25" gridRow="21 / 41"/>
  </Page>

```

## Representing pie charts

```yaml
...
id: 6SzgNldqOM
kind: pie-chart
source:
  elementId: SonP8LBNkD
  kind: table
columns:
- id: GFDmGEXy2n
  formula: '[TRIP/Subscription Type]'
- id: Qtbl8lge9J
  formula: Count([Id])
- id: d61wawsb5y
  formula: '[TRIP/Id]'
- id: FID4i5yQS9
  formula: '[TRIP/Duration]'
- id: GAMFr8Oz65
  formula: '[TRIP/Start Date]'
- id: kOmKh2jZVT
  formula: '[TRIP/Start Station Name]'
- id: iUXx39w9AR
  formula: '[TRIP/Start Station Id]'
- id: CGYSBA5PSg
  formula: '[TRIP/End Date]'
- id: RxYSYJrAB6
  formula: '[TRIP/End Station Name]'
- id: t9edEVxCc5
  formula: '[TRIP/End Station Id]'
- id: 2ZDGxCRQRX
  formula: '[TRIP/Bike Id]'
- id: gYBhUIwQyJ
  formula: '[TRIP/Zip Code]'
color:
  id: GFDmGEXy2n
value:
  id: Qtbl8lge9J
...
```