I don't think Tableau currently supports CTE in Custom SQL. You can have it in Initial SQL but not Custom SQL.
A few work arounds are:
- Move your CTE to a view or table in your database and connect Tableau to it
- Restructure your query so that it doesn't involve CTE or temporary tables
Hope this helps,
Hi Wanda, Thanks for your response.
Yes, Initial SQL is still fine. I'm looking for some kind of work around that is mentioned in this URL: https://kb.tableau.com/articles/HowTo/using-common-table-expressions
I need this to be done against RedShift. Is creating a View still a better way?