I have written some SQL statements and tested them directly in SQL server - they work.
When I try to use same statements in Tableau SQL connection I get an error message. I think I have isolated the issue to a WITH statement in the SQL code.
Does Tableau not allow WITH statements or are there any special formating requirements...? Any input would be appreciated.
I have written something like:
WITH X AS (
[...rest of query referencing to X]
When you use custom SQL in the connection, Tableau wraps this into a subquery, and then queries it to get the results on the screen.
I don't think you can use WITH within a subquery hence your errors.
Are you able to write views in the database? Then you can use Tableau to connect to those.