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

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2024-10-23
- **Format:** Video · 80 min watch · transcript available
- **Topics:** Data visualisation, Tool strategy, Community
- **Tools:** dbt (models); Python (pandas); Sigma; Tableau (calculated fields, cloud, lod expressions, parameters, prep, server)
- **Canonical:** https://just-tim.com/posts/tableau-calculation-export-tool-with-ana-rey-de-castro-tableau-conversations
- **Watch:** https://www.youtube.com/watch?v=fgJjpCZ5Rxc

I sit down with Ana Rey de Castro to explore a free, on-device tool she built that generates lineage diagrams for Tableau calculations. She walks through her journey from screenshotting calculations in Visio to parsing workbook XML and the Tableau Document API, then outputting Mermaid lineage diagrams. We test it across three workbooks of increasing complexity, finishing with one of Andy Kriebel's calculation-heavy templates.

## Key takeaways

- 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.

## Chapters

- 0:00 Introduction and the handover problem
- 1:47 Meet Ana: chemist to data analyst
- 5:06 Centralised vs decentralised team structures
- 7:38 Origins of the lineage tool
- 10:16 From Visio screenshots to XML parsing
- 13:04 Document API vs Metadata API explained
- 16:23 DBT lineage as inspiration
- 19:06 Demo: a simple airline workbook
- 26:07 What Tableau could learn from Sigma
- 29:58 A messy older workbook and number of records
- 38:25 Styling Mermaid diagrams and parameters
- 46:54 Andy Kriebel's calculation masterclass

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/tableau-calculation-export-tool-with-ana-rey-de-castro-tableau-conversations

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
