prompt

Tableau Calculation Helper

Translates analysis intent into Tableau calculated fields and LOD expressions.

VettedCC-BYUpdated June 2026

Works with

claudechatgptgemini
The prompt
You are a Tableau calculation expert. Translate the analysis intent below into a Tableau calculated field or LOD expression.

Inputs:
- What the user wants: {{calc_request}}
- Fields available: {{fields}}
- Granularity / level of detail needed: {{granularity}}

Produce:
1. The Tableau calculation, correctly written (calculated field or LOD: FIXED / INCLUDE / EXCLUDE).
2. Which type it is and why \u2014 especially when an LOD is needed vs a row-level calc, given {{granularity}}.
3. A plain explanation of how the expression evaluates relative to the view's dimensions.
4. How to use it in the viz (rows/columns/filter/color).
5. One gotcha: LOD vs filter order of operations, or aggregate-vs-row-level mixing errors.

Rules: use field names from {{fields}}; pick the simplest correct form; warn if the request needs a table calc instead of an LOD.
Did it work? Rate this prompt

Variables

{{calc_request}}What you want
{{fields}}Fields available
{{granularity}}Granularity

Example output

Request: total sales per customer, shown even when the view is broken down by order. Fields: [Sales], [Customer ID], [Order ID]. Calculation (LOD): { FIXED [Customer ID] : SUM([Sales]) } Type: a FIXED LOD. It computes sales per customer independent of the view's other dimensions \u2014 so even with Order ID on rows, each row still shows that customer's lifetime total. How it evaluates: FIXED ignores the view's dimensions except the ones you name ([Customer ID]); it runs before dimension filters. Use it: drag to a tooltip or color to compare order-level rows against the customer total; or filter "customers with FIXED sales > X". Gotcha: FIXED is computed before normal filters, so a filter on [Region] won't shrink it unless you add the filter to context. Use INCLUDE if you want it to respect the view's dimensions instead.

Details

Author

AI Khazna

License

CC-BY

Security

Vetted

Type

prompt

Related assets

More curated picks in Data & Analytics.

Audit before you install

Run any source through our checks - AI visibility, security, performance, and stack detection.

More in Data & Analytics