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 .tdsx is 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 .twb XML. 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

TableauMalloyNotes
Data sourceOne or more source: definitions
Logical tablesource: 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 fielddimension:IF ... THEN ... ELSE ... END and CASE become pick ... when ... else
Aggregate calculated fieldmeasure: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 sourceMalloy'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_*, RANKcalculate: window functions such as sum_cumulative() and rank() in a queryOrdering and partitioning become explicit order_by: and partition_by:
TOTAL(expr)all(expr)
Data source filterwhere: on the source
Groups and binsA dimension: with pick
SetsA Boolean dimension, or a filter in the query
ParametersA filter in the queryNo direct model equivalent
Caption and comment#(doc) tag
Number formatRender tags such as # currency, # percent
Extract and refresh scheduleNothing to convertSee Materialization and Performance if a source needs to be persisted

Steps

  1. Set up a local modeling directory with cred init (Cred CLI). Put the .tds and .twb files in a subfolder such as tableau/ and add it to .credignore.
  2. 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."
  3. Review the proposed sources, joins and fields. Confirm the cardinality of every relationship.
  4. Compare the key numbers against Tableau with the same filters, including at least one filtered view, as described in Prove Parity.
  5. 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.

Next Steps

On this page