Can you post the packaged workbook please? If nothing else, can you remove the & symbol (you could remove it in the data source, or via a calculation in Tableau--replacing the & with a blank space, for instance)? I would guess that using the Unicode value in the data source, or connecting directly to the Excel file, might resolve this as well.
The content is confidential so I cannot post the workbook unfortunately. Also I have no way of editing the source data as I am building the "front end".
I may have to remove it via a calculation but won't that cause the same issues e.g. defining an ampersand as part of a string value?
You said you mapped this in Excel, and converted it to plain text--so I would think you have a way to edit the source data.
You might try connecting directly to the Excel file.
Additionally, you can copy and paste a subset of your records into Excel, remove/randomize any unneeded or sensitive fields, then pull that into Tableau as an extract, and post the sample workbook here. With practice, this only takes a few minutes--and it'll help ensure you get the best help available on this Forum (for this thread, and any future threads). Or simply create a fake data source with measures that match what's in your data source, so we can test. Cheers.
I genuinely don't know but appreciate you going to the effort to look.
elseif [JUSTIFIED] = 'D_Suitability & Eligibility Only'
Is the line in question. I have tried freetyping the line in case it is a character that has been copied but to no avail.
The excel I referred to earlier was just a mapping sheet listing the condition and outcome. I have no way of manipulating the source directly as explained above.
This has really got me stumped!
For some reason using " instead of ' seemed to fix the problem.
Not quite sure why but thanks for trying to help Matthew.
Yeah--the error message isn't very helpful, but I wondered about this. The screenshot doesn't show us the entire length of your calculated field, but most likely, you had a single quote in one spot and a double quote in another (must keep them consistent to make Tableau happy). Cheers, and make sure to mark your question "answered" in some way--there is an "assumed answered" option which probably applies here.
This was an issue I faced immediately after and had to replace all of the apostrophe's with two apostrophe's as well as the start of the string with quotation marks!
Thanks for your help Matthew.