$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
TableauintermediateNew

Tableau Calculated Fields

Share

Write calculated fields with LOD expressions, table calcs, and sets

Works with OpenClaude

You are a Tableau calculation expert. The user wants to write calculated fields using LOD expressions, table calculations, and sets to solve aggregation and comparative analysis problems.

What to check first

  • Open the Tableau workbook and navigate to Analysis > Create Calculated Field or right-click a dimension/measure in the Data pane
  • Verify your data source has the dimensions and measures needed for the calculation (check the Data pane structure)
  • Confirm whether you need row-level, aggregate, or LOD-scoped calculations by examining your current viz context

Steps

  1. Create a basic calculated field by clicking Create Calculated Field and naming it (e.g., "Sales per Customer")
  2. Write a FIXED LOD expression using {FIXED [Dimension] : SUM([Measure])} to aggregate at a specific dimension level, ignoring viz filters
  3. Write a EXCLUDE LOD expression using {EXCLUDE [Dimension] : SUM([Measure])} to remove one dimension from aggregation scope
  4. Write an INCLUDE LOD expression using {INCLUDE [Dimension] : SUM([Measure])} to add a dimension to the aggregation scope
  5. Create a table calculation by writing SUM([Sales]) / TOTAL(SUM([Sales])) to compute percentages or running totals within partitions
  6. Use the PARTITION BY and ORDER BY clauses in table calcs: RUNNING_SUM(SUM([Sales])) PARTITION BY [Region] ORDER BY [Date]
  7. Create a set-based calculated field using IF [Customer] = [Set Name] THEN 'In Set' ELSE 'Not In Set' END
  8. Validate the calculation by dragging it to a shelf and checking for aggregate vs. dimensionless behavior

Code

// LOD Expression: Total Sales per Customer (FIXED)
{FIXED [Customer ID] : SUM([Sales])}

// LOD Expression: Sales excluding current Product (EXCLUDE)
{EXCLUDE [Product] : SUM([Sales])}

// LOD Expression: Add Sub-Category detail to Region aggregation (INCLUDE)
{INCLUDE [Sub-Category] : SUM([Sales])}

// Table Calculation: Percent of Total Sales
SUM([Sales]) / TOTAL(SUM([Sales]))

// Table Calculation: Running Sum by Region and Date
RUNNING_SUM(SUM([Sales])) PARTITION BY [Region] ORDER BY [Date]

// Table Calculation: Rank within each Segment
RANK([Sales]) PARTITION BY [Segment]

// Set-Based Calculated Field: Flag Top Customers
IF [Customer ID] = [Top 10 Customers] THEN 'Top' ELSE 'Other' END

// Set-Based Calculated Field: Member Check
IF [Region] = [High-Value Regions] THEN 'Included' ELSE 'Excluded' END

// Composite Calculation: Average Sales per Customer (LO

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryTableau
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
tableaucalculationslod

Install command:

curl -o ~/.claude/skills/tableau-calculated.md https://clskills.in/skills/tableau/tableau-calculated.md

Related Tableau Skills

Other Claude Code skills in the same category — free to download.

Want a Tableau skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.