Migrate from Tableau
What to export from Tableau, how Tableau calculated fields, LOD expressions and table calculations map to Malloy, and how to rebuild them with the modeling agent, for Tableau developers and analytics engineers
The logic in Tableau data sources and workbooks moves into Credible through the modeling agent. The agent reads the exported 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. Tableau.
What to Export
- Published data sources: download each as
.tdsx(or.tds). A.tdsxis a zip file; unzip it and keep the.tds, which is XML containing the connections, relationships, calculated fields, captions and comments. Leave any extract (.hyper) out. - Workbooks: download as
.twbx(or.twb) and keep the.twbXML. Calculated fields defined in a workbook rather than the data source are a common place for business logic. - Usage: the views people open most, from Tableau's own usage reporting, to set the scope.
How Tableau Concepts Map to Malloy
| Tableau | Malloy | Notes |
|---|---|---|
| Data source | One or more source: definitions | |
| Logical table | source: over one table | |
| Relationship (logical layer) | join_one: or join_many: | Set the cardinality explicitly; Tableau infers it per query |
| Join or union (physical layer) | A query-based source, or a table built upstream | |
| Row-level calculated field | dimension: | IF ... THEN ... ELSE ... END and CASE become pick ... when ... else |
| Aggregate calculated field | measure: | SUM([Amount]) becomes sum(amount) |
COUNTD([x]) | count(x) | count(x) is distinct in Malloy |
SUM(IF [Status] = "shipped" THEN [Amount] END) | sum(amount) { where: status = 'shipped' } | Filtered aggregate |
DATETRUNC('month', [Date]) | date_field.month | |
{ FIXED [Customer] : SUM([Amount]) } | An aggregate at the customer grain: a query-based source grouped by customer and joined back, or a measure on a joined customer source | Malloy's join-aware aggregates often remove the need for LODs written to avoid double counting |
{ EXCLUDE [x] : ... } | exclude(expr, x) | x must be in the query's output |
{ INCLUDE [x] : ... } | A two-stage query: aggregate at the finer grain, then re-aggregate | |
RUNNING_SUM, WINDOW_*, RANK | calculate: window functions such as sum_cumulative() and rank() in a query | Ordering and partitioning become explicit order_by: and partition_by: |
TOTAL(expr) | all(expr) | |
| Data source filter | where: on the source | |
| Groups and bins | A dimension: with pick | |
| Sets | A Boolean dimension, or a filter in the query | |
| Parameters | A filter in the query | No direct model equivalent |
| Caption and comment | #(doc) tag | |
| Number format | Render tags such as # currency, # percent | |
| Extract and refresh schedule | Nothing to convert | See Materialization and Performance if a source needs to be persisted |
Steps
- Set up a local modeling directory with
cred init(Cred CLI). Put the.tdsand.twbfiles in a subfolder such astableau/and add it to.credignore. - Ask the agent to build the model, naming the folder and the domain: "Build a model of our sales domain using the Tableau data sources and workbooks in
tableau/as prior art." - Review the proposed sources, joins and fields. Confirm the cardinality of every relationship.
- Compare the key numbers against Tableau with the same filters, including at least one filtered view, as described in Prove Parity.
- Publish, then rebuild the views people use as reports or data apps.
What Needs Manual Review
- Table calculations. Their result depends on how a worksheet is laid out and on its Compute Using setting. The agent cannot see that from the XML alone; tell it how each one is computed.
- LOD expressions. Decide which ones express a real business grain and which only worked around duplicated rows from a join. The second kind is usually unnecessary in Malloy.
- Duplicate calculated fields. The same metric defined differently in several workbooks. Pick one definition.
- Data source and workbook permissions, and user filters. These don't carry over. Re-create them with access rules.
- Dashboards and worksheets. Not converted.