Migrate from Sigma
What to export from Sigma, how Sigma data models, metrics and spreadsheet formulas map to Malloy, and how to rebuild them with the modeling agent, for Sigma admins and analytics engineers
The logic in Sigma data models and workbooks moves into Credible through the modeling agent. The agent reads the exported definitions as reference material and drafts the Malloy model from them, checking its proposals against your data. Expect to review the translations more closely than for Looker or Power BI, which have dedicated skills.
Comparing the two products first? See Credible vs. Sigma.
What to Export
- Data models: the code representation of each data model (JSON or YAML) through Sigma's REST API, where your Sigma organization has it. Otherwise, copy each table's source, its columns with their formulas, its metrics and its relationships into a text file.
- Workbook calculations: the calculated columns and metrics defined in workbooks rather than in a data model. These often hold logic that never reached the central model.
- Usage: the workbooks people open most, to set the scope.
How Sigma Concepts Map to Malloy
| Sigma | Malloy | Notes |
|---|---|---|
| Data model table or element | source: | |
| Warehouse table reference | connection.table('schema.table') | |
| Custom SQL element | A query-based source, or a table built upstream | |
| Column with a row-level formula | dimension: | |
| Metric | measure: | |
| Relationship | join_one: or join_many: | Set the cardinality explicitly |
If(cond, a, cond2, b, c) | pick a when cond pick b when cond2 else c | |
Sum, Avg, Min, Max | sum(), avg(), min(), max() | |
Count() | count() | |
CountDistinct([x]) | count(x) | count(x) is distinct in Malloy |
SumIf([Amount], [Status] = "x"), CountIf(...) | sum(amount) { where: status = 'x' }, count() { where: ... } | Filtered aggregate |
DateTrunc("month", [Date]) | date_field.month | |
Lookup | A join | |
| Grouping levels and level-aware calculations | Nested queries (nest:), or all() and exclude() | Review by hand |
| Column description | #(doc) tag | |
| Format | Render tags such as # currency, # percent | |
| Input tables, Python elements | No equivalent | Keep upstream or rebuild separately |
Steps
- Set up a local modeling directory with
cred init(Cred CLI). Put the exported definitions in a subfolder such assigma/and add it to.credignore. - Ask the agent to build the model, naming the folder and the domain: "Build a model of our revenue domain using the Sigma definitions in
sigma/as prior art." - Review the proposed sources, joins and fields. Where the same metric appears in several workbooks with different formulas, choose one definition.
- Compare the key numbers against Sigma with the same filters, as described in Prove Parity.
- Publish, then rebuild the workbooks people use as reports or data apps.
What Needs Manual Review
- Logic duplicated across workbooks. The same metric may be defined in many places, with small differences. Decide which definition is correct.
- Grouping-dependent formulas. Formulas whose result depends on the grouping level of a workbook table need a query shape in Malloy rather than a single measure.
- Metrics from an upstream semantic layer. If a workbook reads metrics from the dbt Semantic Layer or a Snowflake semantic view, migrate those definitions instead. See the dbt and Snowflake guides.
- Permissions and row-level security. These don't carry over. Re-create them with access rules.
- Workbooks and dashboards. Not converted.