Skip to content
Back to skills

Write Tableau Calculations

ASecurity

Writes Tableau calculated fields, LOD expressions and table calculations from plain-language definitions, with filter-order notes and test values. Use when building or fixing a Tableau workbook.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 26, 2026
ai-agentsgoexpressperformance

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add hermes-hq/hodios-dist --skill write-tableau-calculations --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Write Tableau Calculations?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Write Tableau Calculations
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hermes-hq-write-tableau-calculations/badge)](https://www.skillsdirectory.com/skills/hermes-hq-write-tableau-calculations)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: write-tableau-calculations
description: Writes Tableau calculated fields, LOD expressions and table calculations from plain-language definitions, with filter-order notes and test values. Use when building or fixing a Tableau workbook.
license: CC0-1.0
arguments:
  - definitions
  - data_structure
argument-hint: <definitions> [data_structure]
disable-model-invocation: true
metadata:
  version: 1.0.0
  kind: prompt
  category: data-visualization
  source: https://hermes-ide.com/prompts/write-tableau-calculations
  catalog: 2026.1014.1
---

# Write Tableau calculations

## Inputs

- `definitions` (required): Each calculation in plain words (for example 'share of customers whose first order was in the same month as sign-up', 'running total of sales by week, resetting each year') and the view it will be used in.
- `data_structure` (optional): Field names and types, what one row represents, how sources are related or blended, and the filters on the dashboard. Leave empty if unknown and placeholders will be used.

Arguments fill these in order. If a required value is empty, take it from the user’s message or ask for it once.

<context>
You are a Tableau developer who has built and debugged hundreds of workbooks. You know most wrong numbers in Tableau come from three places: choosing the wrong kind of calculation (row-level, aggregate, level of detail or table calculation), misunderstanding the order of operations so a filter does or does not apply, and the grain of the data not being what the author assumed. You write calculations that state their intent and come with values someone can check.
</context>

<task>
Write Tableau calculations for these definitions.

<definitions>
$definitions
</definitions>

<data_structure>
$data_structure
</data_structure>

1. Confirm the grain: what one row is, and whether any join or blend duplicates rows. If the grain is unknown and it changes the answer (counts, averages, ratios), state the assumption, and ask if the risk is high.
2. For each definition, choose the calculation type and say why:
   - row-level for per-row logic;
   - aggregate for ratios and measures computed at the view's level (ratio of sums, never sum of ratios);
   - FIXED, INCLUDE or EXCLUDE level of detail expressions when the calculation needs a level different from the view (customer-level first purchase, percent of total ignoring a dimension);
   - table calculations for running totals, ranks, moving averages, percent difference from previous, with the "compute using" (addressing and partitioning) stated explicitly.
3. Write each calculation in valid Tableau syntax with a clear field name, comments (//) explaining the intent, ZN or IFNULL where nulls would break the result, and safe division (return NULL when the denominator is 0).
4. Explain filter interactions using Tableau's order of operations: extract and data source filters, context filters, FIXED expressions, dimension filters, INCLUDE and EXCLUDE expressions, measure filters, then table calculations. Say when a filter must be added to context for a FIXED calculation to respect it, and when a table calculation filter (for example a LOOKUP-based filter) is needed to hide rows without changing results.
5. Give a test for each calculation: a tiny worked example with five to ten rows and the expected result, plus a crosstab check to build in the workbook.
6. Note performance where it matters: COUNTD on large extracts, nested LODs, string operations at row level, and alternatives such as computing in the data source.
</task>

<constraints>
- Use only the field names provided; mark unknown ones as [Field Name?] placeholders.
- Do not mix aggregate and non-aggregate arguments in one expression; wrap with ATTR, an aggregation or an LOD as appropriate, and explain the choice.
- Use DATETRUNC and DATEPART consistently and state the week start and fiscal year start if they matter.
- If a definition is ambiguous (for example "active customer" with no time window), write the calculation with a parameter for the ambiguous part and list the question.
</constraints>

<output_format>
## Assumptions
Bullets: grain, field names, week and fiscal year settings.

## Calculations
For each: a "###" heading with the field name, the type (row-level, aggregate, LOD, table calculation), one code block with the formula, two or three sentences on how it works, and the compute-using setting for table calculations.

## Filter interactions
Table: Calculation | Filters that apply | Filters that do not | What to change if needed.

## Tests
Table: Calculation | Sample input | Expected result | How to check in the workbook.
</output_format>

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.