Tableau error Syntax
Unterminated string
A text value starts with a quote mark but never ends with one. Tableau then reads everything after it as part of the text.
Which formula raises it, and what fixes it?
IF [Region] = 'East' OR [Region] = 'West' THEN "Coastal Region ELSE "Other Region"
ENDThe xmetric engine rejects it too.
IF [Region] = 'East' OR [Region] = 'West' THEN "Coastal Region"
ELSE "Other Region"
ENDOn each of the 3 example rows it returns:
| Region | Result |
|---|---|
| East | Coastal Region |
| West | Coastal Region |
| Central | Other Region |
Why it works. Every text value needs a matching pair of quotes, either "..." or '...'. Do not mix them on one value. A field name has the same rule with [ and ].
The 3 example rows
Region |
|---|
| East |
| West |
| Central |
What else raises this message?
Raises it
IF [Region] = 'East THEN 1 ENDFixed
IF [Region] = 'East' THEN 1 ENDEvery string needs a closing quote of the same kind.
Checked on the xmetric engine: the first fails, the fix runs.
Raises it
[Region] + "'s totalFixed
[Region] + "'s total"An apostrophe inside double quotes is fine; the double quote still has to close.
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]; 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?
How do I put an apostrophe inside a string?
Wrap the string in double quotes, "O'Brien", or double the apostrophe inside single quotes, 'O''Brien'.
Why does the error show up far from the real mistake?
Everything after an unclosed quote is read as text, so the parser only notices at the end of the formula.
Where is this message documented?
- Where the message is reported (rigordatasolutions.com) checked October 17, 2026