Video · Claude Code · Dashboard Extensions

How to Find Every Unused Field in a Tableau Workbook (AI Extension Build)

Eric builds Workbook X-Ray, a Tableau dashboard extension that reads a .twb or .twbx and lists calculated fields, lineage, unused fields and orphan sheets, then writes a cleaned copy.

JUL 13, 20261:40:4323 chapters

The short version

This is a live workshop. Eric builds Workbook X-Ray, a Tableau dashboard extension that sits inside a workbook and breaks down another workbook: worksheets, dashboards, data sources, every calculated field with its formula, field lineage, unused fields and sheets that are on no dashboard. His test workbook has 423 fields, and 373 of them are unused.

The core constraint shows up in the first minutes. The Extensions API has no idea where the workbook file lives and can't read calc formulas or field usage, so the extension asks you to pick a .twb or .twbx and parses the XML itself in the extension's web files. For a .twbx it pulls out the .twb and leaves the hyper behind.

Eric moves through staged prompts with Claude Code, using his extensions skill to avoid the usual setup errors, and still hits one new error on camera. He adds an unplanned prompt live for cleanup buttons, which rewrite the workbook XML and save a cleaned copy with 373 fields hidden and five orphan sheets deleted. Along the way he covers hosting options, a token tip for long Claude chats, and an early look at his own extension hosting platform.

The breakdown

7:01

The extension can't see the workbook it lives in, so you hand it the file

Eric wanted X-Ray to analyze the workbook it is embedded in automatically. It can't. The dashboard extension API has no information about the workbook's file location or the system it runs on, so the first step is always selecting the workbook.

Once it has the file, the analysis is fast. The finished version shows an overview with warnings for developers, a calculated fields tab (42 calcs in his example), unused fields, lineage, orphan sheets, and a little data source detail, here a hyper extract.

11:48

A skill file cuts out the errors every extension build used to hit

Every extension Eric built used to walk through the same progression of errors from a fresh start. He wrote a skill specific to Tableau extensions to handle those common issues, and Michael, who has been testing it, reports the same.

It still doesn't catch everything. Prompt 0 looked for a starter folder that wasn't in the project, and loading the first .trex threw an error Eric doesn't usually see. His response is to tell Claude to add the fix to the skill so the next build doesn't hit it.

15:09

A .trex is just an XML pointer to web files

To load a dashboard extension, drag the Extension object onto a dashboard and choose Access Local Extensions. What Claude outputs is a .trex file, sometimes called the manifest. It is a small XML file with author, description and version details, plus the URL where the extension's web files are served.

Eric usually keeps two .trex files per extension, one pointing at the public host and one at localhost. The .trex points to index.html, and index.html loads the JavaScript and styles that do the work. In this case you could open that index file in a browser and get the same page.

23:01

For a .twbx, unzip it and analyze only the .twb

A .twbx is a .twb and a hyper file zipped together. Prompt 1 has the extension unzip it, keep the .twb and drop the hyper. Eric notes this also helps when you keep workbook versions in a repository, because you avoid saving the data again with every iteration.

All of the opening and parsing happens in the extension's web files, then shows up as a web page inside the workbook. Tableau itself is not opening the workbook for it.

39:11

Unused means no worksheet and no calculation references the field

Prompt 3 flags a field as unused when no worksheet uses it and no calculated field depends on it. In the example that is 371 fields, which would bring the workbook under 100 used fields. Four of the 42 calculated fields are also unused.

Eric's understanding is that hiding a field removes it from the query sent to a live source or a hyper, so unused fields cost you until they are hidden. Better still is rewriting the source SQL to include only the fields you use. He also points out that fields on orphan sheets still count as used, so deleting those sheets can free more fields.

47:11

Lineage tells you what breaks before Tableau's delete warning does

Prompt 4 adds a lineage tab that includes sheets as well as fields. Pick LOS days and it shows that LOS P12 and LOS T12 reference it and that it sits on four worksheets, so changing it would hit all of those.

Eric is honest about the rough edges. The tree reads in the opposite direction from what he wants (he'd put the base field at the top), it needs a tree navigator to climb back up, and he'd add an impact score for how many downstream objects a field touches.

56:24

Long Claude chats were eating most of his usage

Eric started a new chat for the live prompt on purpose. Anthropic's usage page now breaks out more detail, and it showed that 60 to 65 percent of his usage came from high context prompts, because he tended to run one chat forever.

Now he starts a new chat for each new idea, and he says that brought the number down. He adds that a recent VS Code update coordinates Claude chats within a session, which makes shorter chats easier.

1:25:36

Cleanup writes a new workbook, it never edits the open one

The live prompt added a cleanup section on the unused tab. The extension explains it cannot edit the workbook you have open because the Extensions API is read-only, so the buttons rewrite the workbook XML and download a clean copy. You can pick which fields to hide and which sheets to drop. Eric ran both: 373 fields hidden and five sheets deleted.

Verifying it showed what still needs work. The orphan sheets were gone. The fields were tagged as hidden but still listed as unused, so the tool needs to explain unused versus hidden more clearly. Eric's advice on XML edits: keep a lot of backups, because the XML is touchy.

Key takeaways

  • The Tableau Extensions API can't see the workbook file, calc formulas or field usage, so a workbook analyzer has to read the .twb XML itself.
  • A .twbx is a .twb plus a hyper file zipped together, so the analyzer only needs the .twb.
  • Hiding unused fields matters because, as Eric understands it, hidden fields drop out of the query sent to the data source.
  • A skill file that captures recurring extension errors makes Claude's output more consistent from build to build, and each new error can go back into the skill.
  • Starting a new Claude chat for each new idea cut Eric's high context token usage.
  • Develop against localhost and republish to the public host when you like the result, since every change to a hosted extension needs a republish.

Watch this when

You have a Tableau workbook full of fields nobody uses and want to see how to build an extension that finds them, traces lineage and writes a cleaned copy.

Mentioned in this video