Migrate from Omni
What to export from Omni, how Omni views, topics, relationships and access filters map to Malloy, and how to rebuild them with the modeling agent, for Omni modelers and analytics engineers
An Omni model moves into Credible through the modeling agent. The agent reads the exported model files 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. Omni. The Omni Migration Guide discusses the approach in more depth.
What to Export
- The shared model: the
.viewfiles,.topicfiles and therelationshipsfile, all YAML. Export them from Omni's model IDE, or from the Git repository if the model is connected to one. - Workbook and branch models: fields defined in a workbook or on an unmerged branch rather than in the shared model. Logic often lives there.
- Usage: the dashboards and topics people use most, to set the scope.
How Omni Concepts Map to Malloy
| Omni | Malloy | Notes |
|---|---|---|
View (.view) | source: over one table | |
schema and table_name | connection.table('schema.table') | |
Topic (.topic) | source: with joins | One source per analytical domain |
relationships entry | join_one: or join_many: with an on condition | |
relationship_type: many_to_one / one_to_many | join_one: / join_many: | |
relationship_type: assumed_many_to_one | Flag it | An inferred join; confirm the cardinality |
reversible: true | Two named joins, one per direction | |
join_from_view_as alias | A separately named join | |
join_type (always_left, inner, full_outer) | Review by hand | Changes which rows survive, and so the totals |
primary_key: true | primary_key: on the source | |
Dimension with sql: | dimension: | ${TABLE}.column becomes a plain column reference |
Measure with aggregate_type | measure: with sum(), count(), avg() and so on | count_distinct becomes count(field) |
Measure filters: | measure { where: condition } | Filtered aggregate |
sum_distinct_on and related | Usually a plain aggregate with a primary key set | Malloy's aggregates account for join fan-out when primary keys are declared |
description, ai_context | #(doc) tags | |
default_filters on a topic | A filter in a named view | Users can remove it in Omni, so it is not a source filter |
always_where_sql, always_where_filters | Review by hand | See below |
access_filters | #(access_filter) on the same column | |
required_access_grants | #(authorize) on the source | |
hidden: true | Classify by reason |
Steps
- Set up a local modeling directory with
cred init(Cred CLI). Put the exported YAML in a subfolder such asomni/and add it to.credignore. - Ask the agent to build the model, naming the folder and the domain: "Build a model of our orders domain using the Omni model in
omni/as prior art." - Review the proposed sources, joins and fields. Confirm every assumed relationship and the join type of each join.
- Compare the key numbers against Omni with the same filters, as described in Prove Parity.
- Publish, then rebuild the dashboards people use as reports or data apps.
What Needs Manual Review
- Fields defined in more than one layer. A field can differ between the shared model, a branch, a workbook and a topic's view overrides. Decide which definition is correct.
- Filters users cannot remove.
always_where_sql,always_where_filters,always_having_sqlandalways_having_filterscan be a data-quality rule, a business convention or an access restriction. A restriction becomes an#(access_filter)or#(authorize)rule, a convention becomes part of a named view, and a data-quality rule usually belongs upstream. - Assumed joins. Omni infers some relationships. Confirm each one before keeping it.
- Field-level access.
hidden_unless_access_grantshides a field per user, which is a different control from filtering rows. Decide how to handle it with access rules. - Workbooks and dashboards. Not converted.