Tableau error Syntax

The calculation contains errors

Syntax Error (maybe you are missing an identifier/operator)

Something is missing where Tableau expects a value. The usual cause is an ELSE with nothing after it, right before END.

Updated · Checked on the xmetric engine

Which formula raises it, and what fixes it?

Raises the error
IF [Sales] > 10 THEN 'Over 10' ELSE END
Tableau: Syntax Error (maybe you are missing an identifier/operator)

The xmetric engine rejects it too.

Fixed
IF [Sales] > 10 THEN 'Over 10' ELSE '10 or under' END

On each of the 3 example rows it returns:

RegionSalesResult
East20Over 10
West1010 or under
West510 or under

Why it works. ELSE needs a value to return. If you want an empty result instead, delete ELSE entirely: rows that fail the test then return null.

The 3 example rows
RegionSales
East20
West10
West5

What else raises this message?

  1. Raises it

    [Sales] 2

    Fixed

    [Sales] * 2

    A field and a number side by side need an operator between them.

    Checked on the xmetric engine: the first fails, the fix runs.

  2. Raises it

    IF [Sales] > THEN 'High' END

    Fixed

    IF [Sales] > 10 THEN 'High' END

    A comparison needs a value on both sides.

    Checked on the xmetric engine: the first fails, the fix runs.

Does my formula have this problem?

Paste your formula and run it on the example rows. It uses the fields [Region], [Sales]; rename yours to match.

Runs in your browser on the xmetric engine. Nothing is uploaded.

Which functions does this involve?

What do people ask about this error?

Does a smart quote cause this error?

Yes. A curly quote pasted from a document or chat isn't a string delimiter in Tableau. Retype the quotes as straight ' or ".

Why does Tableau point at the wrong place?

The parser reports where it gave up, which is often after the real mistake. Look just before the highlighted spot.

Where is this message documented?