> ## Content Index
> Fetch the complete content index at: https://www.vizney.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Analyzing Tableau Workbooks with Fewer Tokens (feat. Claude)
- URL: https://www.vizney.com/analyzing-tableau-workbooks-with-fewer-tokens/
- Published: 2026-10-18T10:06:22.000Z
- Updated: 2026-10-18T10:06:22.000Z
- Author: Yehwan Hwang
- Tags: Tips & Tricks

When you analyze a Tableau workbook (`.twb`) with Claude, token usage depends far more on what Claude reads than on which model you use. Give Claude a summary of only the elements you need instead of the raw file. With the Superstore sample, that cuts what it reads to 2% of the original.

The `.twb` of the Superstore sample workbook that ships with Tableau Desktop 2026.2 (1,183 KB) breaks down like this:

- Thumbnail images: 730 KB (62%)
- Formatting, window state, device layouts: 133 KB (11%)
- Field definitions repeated in every sheet: 70 KB (6%)
- Column metadata: 31 KB (3%)

Calculations, filters, sheet structure, dashboard layout, and actions all sit in the remaining 19%.

---

### 1\. Get the `.twb` file.

Open the Superstore sample and use File > Save As to save it as a `.twb`. If your file is a `.twbx`, [unpackage it](https://help.tableau.com/current/pro/desktop/en-us/save%5Fsavework%5Fpackagedworkbooks.htm?ref=vizney.com) and keep only the `.twb`. The analysis doesn’t need the data.

---

### 2\. Attach the `.twb` with this prompt to create a summary file.

```
I want to analyze the attached Tableau workbook (.twb). Don't read or print
the raw XML. Use Python to extract only the elements below and save them
to workbook_summary.md.

[1] Extract: data sources (connections, table relationships, custom SQL,
    data source filters, extract filters), parameters, calculated fields
    (formula and comment), each sheet's rows, columns, marks, and filters,
    the sheets and controls on each dashboard, and actions
[2] Skip: thumbnails, external, metadata-records, style, windows, devicelayouts
[3] Skip each sheet's datasource-dependencies, which repeat the data
    source's field definitions, but keep calculations that exist only
    there (ad-hoc calculations).
[4] Replace internal names in formulas and shelves ([Calculation_…],
    [Parameter 1]) with display names.

After saving, report only the file size and the count of each item.
```

- First line: Raw content Claude reads stays in the conversation and is processed again with every later message. When Python does the work, only the script and its output remain.
- \[2\]: These are the XML names of the elements measured above.
- \[3\]: [Ad-hoc calculations](https://help.tableau.com/current/pro/desktop/en-us/calculations%5Fcalculatedfields%5Fadhoc.htm?ref=vizney.com) typed directly on a shelf are stored only inside the sheet. One example is `SUM([Sales])-SUM([Sales Forecast])` on the What If Forecast sheet.
- \[4\]: Profit Ratio is stored in the XML as `[Calculation_9921103144103743]`. Without this line, that name stays in the summary.
- Last line: This keeps the summary from being printed back into the chat. Counts such as 21 sheets and 6 dashboards are enough to check for gaps.

Run with Sonnet, the prompt produced a 23 KB summary, 2% of the original.

[workbook\_summary\_enworkbook\_summary\_en.md23 KBdownload-circle](https://www.vizney.com/content/files/2026/10/workbook%5Fsummary%5Fen.md "Download")

---

### 3\. Continue in a new conversation with only the summary attached.

Download the summary, attach it to a new conversation, and ask something like “Write a handover document based on this summary.”

- Current conversation length and file attachment size count toward usage limits ([Usage limit best practices](https://support.claude.com/en/articles/9797557-usage-limit-best-practices?ref=vizney.com)). A new conversation is therefore lighter than one that still carries the extraction work.
- If you’ll keep working on the same workbook, add the summary to a project. Project content is cached and counts less against your limits when reused.

---

### 4\. Match the model to the step.

- Cutting volume matters more than switching models. Moving from Opus 5.5 to Sonnet 5.5 halves the per-token price on the API ([Pricing](https://platform.claude.com/docs/en/about-claude/pricing?ref=vizney.com)). Moving to the summary cuts what Claude reads to 2% of the original.
- Extraction: Pulling a fixed set of elements out with code is work Sonnet handles well.
- Interpretation: Give Opus the logic where LOD expressions, parameters, and actions interact.
- Splitting the work: If you want Opus to outline and Sonnet to fill in, do it in a conversation that starts from the summary. If you switch models in a conversation that has already read the raw file, the new model inherits that whole conversation.

---

### Notes

- The summary keeps connection details and file paths as they appear in the workbook, so review it before sharing.
- Running Python requires Claude’s Code execution and file creation setting, which is on by default.