Errors 20 pages, all live in your browser
Tableau calculation errors
Find the exact message Tableau showed you. Each page shows a formula that raises it, the fix, more formulas that raise the same message, and a checker that runs your formula on the xmetric engine in your browser.
Syntax
The formula can't be read: a missing END, quote, parenthesis or value.
- Expected 'END' to match 'IF'You wrote ELSE IF with a space.
- Expected closing parentheses or commaA function call is missing its closing ) or a comma between arguments.
- Expected 'END' to match 'IF' at character 0Your IF has no END.
- Syntax Error (maybe you are missing an identifier/operator)Something is missing where Tableau expects a value.
- Unterminated stringA text value starts with a quote mark but never ends with one.
Type mismatch
Text, numbers, dates and booleans used where another type is expected.
- Cannot add string and float valuesYou used + to join text and a number.
- Can’t add string and datetime valuesThe + sign joins text only when every part is text.
- Can't compare string and float valuesYour field holds numbers, but Tableau reads it as text.
- Can’t divide string values by float valueThe field on the left of / is text, even if it looks like a number.
- expected type float found booleanCASE compares one field against each WHEN value.
- Expected type integer, found string.Result types from 'IF' expressions must match.The branches of your IF return different types: a number after THEN, text after ELSE.
Aggregation
Row-level fields and aggregates mixed in one expression.
- Argument to sum (an aggregate function) is already an aggregation, and cannot be further aggregated.You wrapped an aggregate in another aggregate, like SUM(SUM([Sales])).
- Cannot mix aggregate and non-aggregate arguments with this function.Your formula puts a row-level field and an aggregate such as SUM in the same expression.
- Cannot mix aggregate and non-aggregate comparisons or results in 'IF' expressions.The IF test reads one row, YEAR([Order Date]), but the result is a group total, SUM([Profit]) / SUM([Sales]).
Level of detail
What a FIXED, INCLUDE or EXCLUDE expression may contain.
Table calculation
What a table calculation needs around it.
Dates
Date functions called with text or a wrong argument.
- DATEDIFF is being called with (string, date, string)One of your dates is stored as text.
- DATEDIFF is being called with (string, date, date, integer). Did you mean (string, datetime, datetime, string)?The fourth argument of DATEDIFF is the first day of the week, and it must be text such as 'sunday' or 'monday'.
Function arguments
A function called with the wrong number of arguments.