Example representation: Workbook with a KPI (Beta)

View as Markdown

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:

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:

  1. Go to the Home page.

  2. Select 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 TRIP in the EXAMPLES.BIKES schema.

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

    The table appears in the workbook.

  6. Select 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:

    OptionSetting
    Chart typeKPI
    ValueSum of Duration
  8. In the document header, select Save as.

  9. Enter a name for the workbook, such as kpi.

  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.

The code representation of this workbook appears like the following:

1workbookId: 7e180c04-d072-41aa-8ee9-c027e9aba593
2name: kpi
3url: https://aws-api.sigmacomputing.com/org-name/workbook/kpi-h2n0HmWep62n47v2BdlwxM
4documentVersion: 2
5latestDocumentVersion: 2
6ownerId: IaYwubYCIBXp9gO8BswaUtcHqxc0b
7folderId: d82c1201-67bb-40a2-896f-52fea951b651
8createdBy: IaYwubYCIBXp9gO8BswaUtcHqxc0b
9updatedBy: IaYwubYCIBXp9gO8BswaUtcHqxc0b
10createdAt: '2026-04-20T20:09:54.756Z'
11updatedAt: '2026-04-21T14:54:26.281Z'
12document:
13 schemaVersion: 1
14 elements:
15 - id: Fj2xc63ViF
16 kind: table
17 source:
18 connectionId: 709342a2-de05-41f5-be61-44e81f753327
19 kind: warehouse-table
20 path:
21 - FUN
22 - BIKES
23 - TRIP
24 columns:
25 - id: nzi5dRVpp6
26 formula: '[TRIP/Id]'
27 - id: cNN9spbNez
28 formula: '[TRIP/Duration]'
29 - id: ET5qp4jaoT
30 formula: '[TRIP/Start Date]'
31 - id: 9Oc7eABuun
32 formula: '[TRIP/Start Station Name]'
33 - id: BaQnGJHCpf
34 formula: '[TRIP/Start Station Id]'
35 - id: vOShuPwC04
36 formula: '[TRIP/End Date]'
37 - id: 0Km2IlC64a
38 formula: '[TRIP/End Station Name]'
39 - id: bkvxSHeCqg
40 formula: '[TRIP/End Station Id]'
41 - id: ahFVj6GAA0
42 formula: '[TRIP/Bike Id]'
43 - id: lboOBBg1EI
44 formula: '[TRIP/Subscription Type]'
45 - id: NlBo69LWBL
46 formula: '[TRIP/Zip Code]'
47 order:
48 - nzi5dRVpp6
49 - cNN9spbNez
50 - ET5qp4jaoT
51 - 9Oc7eABuun
52 - BaQnGJHCpf
53 - vOShuPwC04
54 - 0Km2IlC64a
55 - bkvxSHeCqg
56 - ahFVj6GAA0
57 - lboOBBg1EI
58 - NlBo69LWBL
59 - id: GOYjFOgBn9
60 kind: kpi-chart
61 source:
62 elementId: Fj2xc63ViF
63 kind: table
64 columns:
65 - id: gohvY5umeI
66 formula: Sum([Duration])
67 - id: TNruEbslBc
68 formula: '[TRIP/Id]'
69 - id: ul7rL9u9ZR
70 formula: '[TRIP/Duration]'
71 - id: rNkiCFNtjF
72 formula: '[TRIP/Start Date]'
73 - id: 0xHDnLUELo
74 formula: '[TRIP/Start Station Name]'
75 - id: p0x4GX9Bey
76 formula: '[TRIP/Start Station Id]'
77 - id: 8s2Vwpfge2
78 formula: '[TRIP/End Date]'
79 - id: CSbgiOiNiK
80 formula: '[TRIP/End Station Name]'
81 - id: f8sDb53mXh
82 formula: '[TRIP/End Station Id]'
83 - id: ewoNp0smGk
84 formula: '[TRIP/Bike Id]'
85 - id: kQ9TYxqT02
86 formula: '[TRIP/Subscription Type]'
87 - id: 0m6n9QoaNF
88 formula: '[TRIP/Zip Code]'
89 value:
90 columnId: gohvY5umeI
91 pages:
92 - id: tgm1nceWza
93 name: Page 1
94 kind: workbook
95 layout: |
96 <?xml version="1.0" encoding="utf-8"?>
97 <Page type="grid" gridTemplateColumns="repeat(24, 1fr)" gridTemplateRows="auto" id="tgm1nceWza">
98 <Element elementId="Fj2xc63ViF" gridColumn="1 / 25" gridRow="1 / 21"/>
99 <Element elementId="GOYjFOgBn9" gridColumn="1 / 25" gridRow="21 / 41"/>
100 </Page>

Representing KPIs

1...
2id: GOYjFOgBn9
3kind: kpi-chart
4source:
5 elementId: Fj2xc63ViF
6 kind: table
7columns:
8- id: gohvY5umeI
9 formula: Sum([Duration])
10- id: TNruEbslBc
11 formula: '[TRIP/Id]'
12- id: ul7rL9u9ZR
13 formula: '[TRIP/Duration]'
14- id: rNkiCFNtjF
15 formula: '[TRIP/Start Date]'
16- id: 0xHDnLUELo
17 formula: '[TRIP/Start Station Name]'
18- id: p0x4GX9Bey
19 formula: '[TRIP/Start Station Id]'
20- id: 8s2Vwpfge2
21 formula: '[TRIP/End Date]'
22- id: CSbgiOiNiK
23 formula: '[TRIP/End Station Name]'
24- id: f8sDb53mXh
25 formula: '[TRIP/End Station Id]'
26- id: ewoNp0smGk
27 formula: '[TRIP/Bike Id]'
28- id: kQ9TYxqT02
29 formula: '[TRIP/Subscription Type]'
30- id: 0m6n9QoaNF
31 formula: '[TRIP/Zip Code]'
32value:
33 columnId: gohvY5umeI
34...