Example representation: Workbook with a KPI (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.
If you are interested in joining a limited test group and enabling this feature in your Sigma organization, contact Support or reach out to your Account Executive.
This is an example representation of a workbook, created using the get a workbook representation endpoint. Representations like this one can be used to create a workbook from code using the create a workbook from a representation 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 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.
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 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 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.
This example uses a table from the Sigma 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 KPI chart.
To create this workbook in the Sigma UI:
-
Go to the Home page.
-
Select
Create new > Workbook.
A new workbook opens.
-
From the Add element bar, select Data > Table.
-
In the Select source modal, search for the table
TRIPSin theEXAMPLES.BIKESschema. -
Select the table to add it to the workbook.
The table appears in the workbook.
-
Select
Add child element > Chart.
A new bar chart element appears on the workbook canvas.
-
In the editor panel, select Properties and configure the chart with the following settings:
Option Setting Chart type KPI Value Sum of Duration -
In the document header, select Save as.
-
Enter a name for the workbook, such as
kpi. -
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.
The code representation of this workbook appears like the following:
YAML representation
workbookId: 78edf2ac-52e3-4198-9ed0-9add58a6a7a0
name: kpi
url: https://aws-api.sigmacomputing.com/org-name/workbook/kpi-s84XnhWGyFhFu5jJgFaoBP
documentVersion: 2
latestDocumentVersion: 2
ownerId: Ipb0LILcSmxdd6uZFfy2EJLR6N2nr
folderId: 2cfd0815-2749-49b4-9a07-46684d13e7d0
createdBy: Ipb0LILcSmxdd6uZFfy2EJLR6N2nr
updatedBy: Ipb0LILcSmxdd6uZFfy2EJLR6N2nr
createdAt: '2026-04-20T20:09:54.756Z'
updatedAt: '2026-04-21T14:54:26.281Z'
schemaVersion: 1
pages:
- id: gKekTEshIz
name: Page 1
elements:
- id: kRPIWHQONr
kind: table
source:
connectionId: d6bfeea1-5da2-458c-9bcf-ec9400d24ceb
kind: warehouse-table
path:
- FUN
- BIKES
- TRIP
columns:
- id: G5q89eODCE
formula: '[TRIP/Id]'
- id: LBpTp5vmHR
formula: '[TRIP/Duration]'
- id: iie4CViO8Y
formula: '[TRIP/Start Date]'
- id: T2iGdtWEmT
formula: '[TRIP/Start Station Name]'
- id: MiBhYtjS6N
formula: '[TRIP/Start Station Id]'
- id: 1MkzowZXls
formula: '[TRIP/End Date]'
- id: V2qawmXTEt
formula: '[TRIP/End Station Name]'
- id: wLjbuYBEqS
formula: '[TRIP/End Station Id]'
- id: s90Fhq1odB
formula: '[TRIP/Bike Id]'
- id: gCN12n56ES
formula: '[TRIP/Subscription Type]'
- id: 76aGlJ6IqQ
formula: '[TRIP/Zip Code]'
order:
- G5q89eODCE
- LBpTp5vmHR
- iie4CViO8Y
- T2iGdtWEmT
- MiBhYtjS6N
- 1MkzowZXls
- V2qawmXTEt
- wLjbuYBEqS
- s90Fhq1odB
- gCN12n56ES
- 76aGlJ6IqQ
- id: bcZscvxwWM
kind: kpi-chart
source:
elementId: kRPIWHQONr
kind: table
columns:
- id: jla2NWc1VC
formula: Sum([Duration])
- id: ZJpNz9bfjd
formula: '[TRIP/Id]'
- id: A12deWm7oo
formula: '[TRIP/Duration]'
- id: 3MlGv8QR5E
formula: '[TRIP/Start Date]'
- id: DQlkXmUtnU
formula: '[TRIP/Start Station Name]'
- id: rqvFOt8kL7
formula: '[TRIP/Start Station Id]'
- id: radyS7AGHg
formula: '[TRIP/End Date]'
- id: Tmv4MZEJaM
formula: '[TRIP/End Station Name]'
- id: eXJTpUnxPT
formula: '[TRIP/End Station Id]'
- id: qBGPobtQk3
formula: '[TRIP/Bike Id]'
- id: 7DJxvQWO5d
formula: '[TRIP/Subscription Type]'
- id: NyO9JlwrbT
formula: '[TRIP/Zip Code]'
value:
columnId: jla2NWc1VC
layout: |
<?xml version="1.0" encoding="utf-8"?>
<Page type="grid" gridTemplateColumns="repeat(24, 1fr)" gridTemplateRows="auto" id="gKekTEshIz">
<LayoutElement elementId="kRPIWHQONr" gridColumn="1 / 25" gridRow="1 / 21"/>
<LayoutElement elementId="bcZscvxwWM" gridColumn="1 / 25" gridRow="21 / 41"/>
</Page>
Representing KPIs
KPI representation
...
id: bcZscvxwWM
kind: kpi-chart
source:
elementId: kRPIWHQONr
kind: table
columns:
- id: jla2NWc1VC
formula: Sum([Duration])
- id: ZJpNz9bfjd
formula: '[TRIP/Id]'
- id: A12deWm7oo
formula: '[TRIP/Duration]'
- id: 3MlGv8QR5E
formula: '[TRIP/Start Date]'
- id: DQlkXmUtnU
formula: '[TRIP/Start Station Name]'
- id: rqvFOt8kL7
formula: '[TRIP/Start Station Id]'
- id: radyS7AGHg
formula: '[TRIP/End Date]'
- id: Tmv4MZEJaM
formula: '[TRIP/End Station Name]'
- id: eXJTpUnxPT
formula: '[TRIP/End Station Id]'
- id: qBGPobtQk3
formula: '[TRIP/Bike Id]'
- id: 7DJxvQWO5d
formula: '[TRIP/Subscription Type]'
- id: NyO9JlwrbT
formula: '[TRIP/Zip Code]'
value:
columnId: jla2NWc1VC
...