Guides 220 pages, all live in your browser

Tableau functions to SQL

Pick a function. Each page runs the Tableau formula on the xmetric engine and the SQL on DuckDB over the same sample rows, shows that both return the same numbers, and shows the tempting SQL that does not.

Updated

Convert a whole formula

Paste any calculated field and get SQL, checked on rows in your browser.

Level of detail

FIXED, INCLUDE and EXCLUDE: aggregates at a grain other than the view, and how filters reach them.

Table calculations

Calculations across the marks in the view: running totals, ranks, windows, lookups.

Aggregates

SUM, AVG, COUNTD and the statistics, including how they treat nulls.

Dates

Date parts, truncation, arithmetic and parsing, with week starts and ISO calendars.

Logic

IF, CASE, IIF and null tests.

Numbers

Rounding, division, logarithms, trigonometry and null handling.

Strings

Search, slicing, case, trimming and regular expressions.

Type conversion

Converting between text, integers and decimals.

User functions

Who is viewing: the functions behind row-level security.

Pass-through SQL

SQL passed straight to the data source.

Spatial

Points, lines and WKT geometry.

Operators

Arithmetic, comparison and logical operators, and their precedence.

Looking for SQL or DAX?