xmetric / Open a file

Unpack a .twbx File to Export Underlying Data and SQL Logic

To pull both the data and the business logic out of a .twbx file, drop the workbook into xmetric's free workbook inspector or unzip it from your terminal. The inspector reads the workbook in your browser, resolves internal field IDs to readable calculated field formulas, and lets you save packaged data files such as bundled CSVs. Then rewrite each formula as SQL.

Open your own workbook

Try it on your own CSV

Drop a .twbx or .twb. This page lists its dashboards, sheets, data sources and every calculated field with its formula, and lets you save the files packaged inside. It runs in this browser; the file is not uploaded.

No file loaded yet. You can also drop a workbook on this box.

Why unpacking a .twbx file is only half the job

Analytics engineers and consultants frequently inherit a legacy .twbx workbook and are asked to either pull the underlying data out to a clean CSV or migrate the report's business logic into SQL / dbt models.

If you simply unzip the .twbx file, you run into two roadblocks:

  1. The data may be inside a .hyper binary: Unless the author bundled a plain CSV or Excel file, the extract rows sit inside Data/Extracts/*.hyper (which requires Python's tableauhyperapi or a desktop tool to export to CSV).
  2. The business logic is buried in .twb XML: Calculated fields, KPIs, cohort definitions, and filtering rules are NOT stored as columns in the raw table. They are computed at query time from Tableau formulas inside the .twb file using opaque internal IDs like [Calculation_3849201829].

If you export only the raw table without the calculated fields, your numbers will not match the dashboard.

Step-by-step: extract data and logic in your browser with xmetric

Dropping your .twbx file into xmetric lets you see the packaged files and the calculation layer together in one place:

  1. Inspect the .twbx locally: Drop your .twbx file into the box above. The workbook inspector reads the archive in your browser with no upload and lets you save packaged data files (such as a CSV inside the .twbx).
  2. Read the resolved schema and export JSON: View all data sources, sheets, dashboards, and every calculated field, formula, and dependency (including broken or unused calculations), or export the full inspection report as JSON.
  3. Test the formulas: Run any calculated field, Level of Detail (FIXED, INCLUDE, EXCLUDE) expression, or table calculation on sample data in the formula playground to confirm what it returns before you rewrite it in SQL.
  4. Check the numbers: Open the .twbx in the xmetric app to rebuild a sheet on shelves and compare it with your SQL output. Not every dashboard will look identical to Tableau.

Example: migrating a multi-layer .twbx KPI into a dbt / SQL query

Suppose a legacy .twbx revenue workbook defines "Net Expansion ARR" using two chained calculated fields:

// Field 1: Prior Quarter ARR (Table Calculation)
LOOKUP(SUM([ARR]), -1)

// Field 2: Net Expansion ARR
ZN(SUM([ARR])) - ZN([Prior Quarter ARR])

Once the inspector shows you both fields, you can translate the entire chain into a single, self-contained SQL query:

WITH quarterly_arr AS (
  SELECT
    account_id,
    DATE_TRUNC('quarter', invoice_date) AS quarter_start,
    SUM(arr) AS current_arr
  FROM subscriptions
  GROUP BY account_id, DATE_TRUNC('quarter', invoice_date)
)
SELECT
  account_id,
  quarter_start,
  current_arr,
  LAG(current_arr, 1) OVER (
    PARTITION BY account_id
    ORDER BY quarter_start
  ) AS prior_quarter_arr,
  COALESCE(current_arr, 0) - COALESCE(
    LAG(current_arr, 1) OVER (
      PARTITION BY account_id
      ORDER BY quarter_start
    ),
    0
  ) AS net_expansion_arr
FROM quarterly_arr
ORDER BY account_id, quarter_start;

Unpacking a .twbx from the command line

If you also want to extract the raw bundled files on disk, run unzip on the .twbx archive (every .twbx packaged workbook is a standard ZIP archive containing the .twb XML file and supporting local data files):

mkdir extracted_workbook
unzip legacy_report.twbx -d extracted_workbook/
find extracted_workbook/ -type f

Typical directory tree inside extracted_workbook/:

Questions people ask

Can I export data from a .twbx without paying for Tableau Desktop or Tableau Prep?

Yes. A paid Tableau Creator license (which includes Tableau Desktop, Tableau Prep Builder, and a Server/Cloud Creator seat) costs $75 per user/month, billed annually (as of October 2026), but you have several free options: drop the .twbx into xmetric's free workbook inspector to save packaged CSV files and see all formulas, unpack the .twbx as a .zip archive (and use Python's tableauhyperapi if the data is in .hyper format), or install Tableau Desktop Free Edition (for one local user on Windows or Mac) or Tableau Reader (free on Windows and Mac) to export data from a view.

Why don't the columns in my exported CSV match the fields shown on the Tableau dashboard?

Because Tableau dashboards frequently display calculated fields, bins, groups, and sets that only exist in the .twb XML layer, not in the underlying data extract. Open the .twbx in xmetric's workbook inspector to list all calculated fields and their formulas so you can include them in your SQL model.

Can an AI coding agent extract SQL from a .twbx using xmetric?

Today you can export the complete workbook structure, data sources, and resolved formulas as JSON from xmetric's workbook inspector and hand that file to your agent. An xmetric MCP server for agents is coming (and if your organization uses Tableau Cloud, Tableau MCP is included in every Tableau Cloud edition).

Drop your .twbx file into the box at the top of this page to see its data sources, packaged files and formulas in your browser.