Video | Tableau | Data visualisation | Tool strategy | Community

Tableau Calculation Export Tool with Ana Rey de Castro | Tableau Conversations

Ana built a free, on-device tool that maps your Tableau calculations into a lineage diagram — no cloud, no fuss, just XML and Mermaid.

Part ofGuest Appearences
Watch on YouTube
  • You can unzip a packaged Tableau workbook (.twbx) to reach the .twb file, which is XML metadata containing every calculation — and the Tableau Document API can extract those fields programmatically without parsing XML yourself.
  • The Document API reads calculations from a workbook file, while the Metadata API queries upstream and downstream lineage of assets published to Tableau Server or Cloud.
  • Ana's tool runs entirely on device (Windows only, due to the win32com client library), is free, and lives on GitHub — outputting calculations to Excel/PDF plus a Mermaid lineage diagram as an HTML/PNG/SVG export.
  • Mermaid diagrams can be restyled at mermaidchart.com — colour-coding default fields, parameters and calculated fields — making the lineage useful for documentation, handovers and migration planning.
  • Number of records appears as a calculated field when opening older workbooks because legacy Tableau created it as a field with value one; modern Tableau replaces it with a native count.

Ana Rey de Castro built a free, on-device tool that parses a Tableau workbook's XML to extract every calculation and generate a lineage diagram, solving the problem of handing over or documenting workbooks full of tangled calculated fields.

The problem: workbooks accumulate calculated fields referencing other calculated fields, and there's no built-in way to see how they connect — handover and documentation become painful. Ana's own trigger was manually screenshotting calculations into Visio to keep a stakeholder-facing diagram up to date.

The Breakdown
  • The handover problem with tangled calculations 0:00

    Workbooks with lots of interdependent calculated fields become hard to hand over or document because there's no native way to see which calculation depends on which.

  • From manual Visio diagrams to parsing XML 10:16

    Ana started by manually screenshotting calculations into Visio and colour-coding relationships by hand, but this didn't scale as workbooks changed. Realising a saved workbook is just XML metadata, she moved to scraping that XML directly to extract calculated fields programmatically rather than maintaining diagrams by hand.

  • Document API vs Metadata API 13:04

    The Tableau Document API reads calculations and fields out of a workbook file itself (also used by Tableau Prep to unpack flow files), while the Metadata API queries upstream/downstream lineage for assets already published to Tableau Server or Cloud. Use the Document API when you're working from a local file; use the Metadata API when you need lineage across published content.

  • Unzip a .twbx to get at the XML yourself 15:47

    A packaged workbook (.twbx) can be unzipped to reveal the .twb, which is plain XML containing every calculation, field ID, comment and data type — so even without the Document API you can inspect a workbook's calculations directly.

  • What the tool outputs 19:06

    Given a workbook, the tool lists every field with its type, real field ID, formula and any comments, exports this to Excel/PDF, and also generates a Mermaid lineage diagram showing which calculations depend on which — distinguishing default fields, parameters and calculated fields.

  • Watch out for 'Number of Records' in older workbooks 31:58

    Opening a workbook built in older Tableau versions can show 'Number of Records' as a calculated field (legacy Tableau created it as a field with value one); newer workbooks get it as a native count instead, so don't be alarmed if it shows up as a calculation in old files.

  • Restyle and export the diagram 38:45

    Mermaid output can be pasted into mermaidchart.com to restyle colours, spacing and layout for a cleaner, more professional-looking diagram, then exported as HTML, PNG or SVG for documentation or sharing — SVG stays sharp at any size, useful for presentations.

  • Scaling to complex, calculation-heavy workbooks 46:54

    Testing against an intentionally calculation-dense template (one of Andy Kriebel's) showed the tool coping with far larger numbers of interdependent fields, runs entirely on-device with no cloud dependency, and is genuinely useful for reverse-engineering how a complex parameter-driven visual actually works field by field.

Worth Knowing
  • The tool is Windows-only because it depends on the win32com client library.
  • It's free and open source on GitHub, built and shared by Ana rather than an official Tableau product.
  • Mermaid's free tier/export has a diagram limit, so very large workbooks may need managing in batches.
  • It only extracts what's in the workbook's calculations — it won't format or restyle nicely by default; you need mermaidchart.com for a polished look.
Use It When

Reach for this when you're inheriting, documenting or migrating a workbook full of layered calculated fields and need to quickly see what depends on what, without manually tracing formulas or maintaining a diagram by hand.

How this Rollup was made provenance & method

A Rollup is drafted by AI from the video's transcript, then reviewed and edited by Tim. Everything used to produce this one is listed below — the model, the exact prompt, and the source video — so the process is transparent and reproducible.

Transcription
On-device — NVIDIA Parakeet v3 for recent videos, OpenAI Whisper large-v3 for earlier ones. The transcript never leaves the machine or gets published.
Drafting
Claude Sonnet 5 in the cloud, from that transcript.
Prompt
The exact Rollup prompt (v2) — the full system prompt, unedited.
Source video
Watch on YouTube
Drafted
5 July 2026 at 09:38
Reviewed & edited
5 July 2026 at 09:41 · by Tim Ngwena

Model + prompt + video is everything you'd need to recreate a Rollup like this yourself. The one thing we don't share is the transcript.

Rights. The video and its transcript are the property of TN Media Ltd. Unauthorised use or download is prohibited. © TN Media Ltd.