Search code examples
tableau-apitableau-desktop

Tableau: "Unknown function DATEPARSE called" after data source migration


Small question regarding Tableau and the DATEPARSE function please.

I used to have a CSV, nothing special, that has a column Mytimestamp. The values of the column Mytimestamp would be just like those: Mytimestamp 1628670242328 1619671382146

DATE(DATEPARSE ( "yyyy-MM-dd HH:mm:ss", STR(DATEADD('second', (INT([Mytimestamp]/1000)), #1970-01-01#)) ))

Again, this worked really great, no problem. Now, we have couple of other data sources, and I just replaced the original data source, the CSV file, to those new datasource.

Unfortunately, all dashboard using this broke, with this issue. "Unknown function DATEPARSE called".

May I ask how to fix this, and get the behavior I was having with the CSV please? What would be an alternative to this DATEPARSE function which can help "convert" those timestamps into a human readable format.

Thank you


Solution

  • The correct answer is to use DATETIME

    DATE(DATEPARSE ( STR(DATEADD('second', (INT([Mytimestamp]/1000)), #1970-01-01#)) ))
    

    Some data sources, such as CSV, supports DATEPARSE But some others does not, and the DATETIME is the answer.