Function table / Level of detail / Exclude all view dimensions

Exclude all view dimensions, from Tableau to SQL

Removing every view dimension produces a global total. Below, 8 sample rows go through the calculation and through the SQL, and both return the same numbers.

Calculated field

{ EXCLUDE [Region], [Team] : SUM([Revenue]) }

Sample data

RegionTeamCustomerRevenueSeatsDate
NorthCedarAster12042026-01-05
NorthCedarAster8022026-02-05
NorthCedarBirch30062026-01-12
NorthPineClover9032026-02-14
SouthElmDahlia20052026-01-08
SouthElmDahlia10022026-02-08
SouthAshFern7532026-01-20
SouthAshFern2512026-02-20

The same calculation as SQL

SELECT "Region", "Team", (SELECT SUM(Revenue) FROM input) AS result FROM input  GROUP BY "Region", "Team" ORDER BY "Region", "Team"

Runs the example above.

Result

RegionTeamresult
NorthCedar990
NorthPine990
SouthAsh990
SouthElm990

Same rows from the calculation and from the SQL in DuckDB.

Where a naive translation goes wrong

  • Grouping at the visible Region and Team grain does not exclude those dimensions.

    Naive SQL

    SELECT "Region", "Team", SUM(Revenue) AS result FROM input  GROUP BY "Region", "Team" ORDER BY "Region", "Team"
    RegionTeamresult
    NorthCedar500
    NorthPine90
    SouthAsh100
    SouthElm300

    Matches the calculation

    SELECT "Region", "Team", (SELECT SUM(Revenue) FROM input) AS result FROM input  GROUP BY "Region", "Team" ORDER BY "Region", "Team"
    RegionTeamresult
    NorthCedar990
    NorthPine990
    SouthAsh990
    SouthElm990

Signature

{ EXCLUDE [Region], [Team] : SUM([Revenue]) }