forums
Use these forums to ask questions and discuss Tableau.
TableauTemp table in 4.0
I recently migrated a workbook from Tableau 3.6 to 4.0. The data source is an Excel spreadsheet that is extracted in order to improve performance. One of my RAWSQL functions would not work, and I determined that Tableau was referring to my data table as "TableauTemp" instead of the usual table name (the name of the Excel sheet + "$" ). Looking through the log, it appears that Tableau created copied my data table into a temp table with this name.
I normally am not too concerned about what Tableau does behind the scenes, but in this case I had to rewrite a RAWSQL command to refer to "TableauTemp" instead of the usual table name in order for the function to work.
Does anyone know whether this is a known issue with Tableau 4.0, and whether the temp table names are stable and predictable. I do need to hand off these workbooks to non-technical users who would be unable to troubleshoot and correct the errors that would arise if the table name were to change.
Comments
Are you sure you need to refer to the table name? The RAWSQL_* functions let you refer to columns by substitution instead of explicitly. For example, if you wanted to directly add two columns (because Tableau didn't do addition?) you could say:
RAWSQL_REAL('%1 + %2',[column1],[column2])as opposed to saying:
RAWSQL_REAL('[table].[column1]+[table].[column2]')or whatever the appropriate raw syntax would be for the database in question.
A shorter answer is: Yes, the names have changed. Yes, they are stable and predictable. No, there is no guarantee they won't change again, and there are query compilation situations where a hard reference to a table name may cause the query to be invalid, because Tableau does not parse your custom SQL, it just passes it through.
Here is the calculated field formula in question. It contains a subquery which returns the most recent date in a column of the source table.
RAWSQL_DATE('SELECT MAX("Date/Time") FROM "TableauTemp"')
I then apply the DATETRUNC function to identify records in the most recent week, in order to compare this week's stats with all previous weeks.
I am unaware of a way to write this without specifying the name of the table. If anyone does, please let me know.
Hi Aaron -
Excel does not support temporary tables(!) so we actually instantiate the filtered data in the context into a temporary Access database and [TableauTemp] is the name of the table we store the filtered data in. That name is completely stable because there are no other tables it might conflict with (i.e. we don't mangle it in any way.)