KNOWLEDGE BASE

Error "The literal '#date#' is not a valid date" in Mac and Linux OS


Published: 22 Nov 2018
Last Modified Date: 21 Jan 2019

Issue

Published views might become blank in Tableau Server and Tableau Online running on Linux OS when using dates separated by commas. When using web-edit, the calculated field that uses date separated by commas shows that the calculation is invalid with the following error:

The literal '#date#' is not a valid date.

The issue also occurs in Tableau Desktop running on a Mac machine.

 

Environment

  • Tableau Online
  • Tableau Server
  • Tableau Desktop
  • Linux OS
  • Mac OS

Resolution

To workaround the issue, please review the options below:

OPTION 1: Replace #date# the date function DATEPARSE(). Example:

Replace this:
IF [Order Date ]< #01,08,2018#
THEN #01,08,2018# else [Order Date]
END
With this:
IF [Order Date]< DATEPARSE("dd,MM,yyyy","01,08,2018")
THEN DATEPARSE("dd,MM,yyyy","01,08,2018")
ELSE[Order Date]
END
OPTION 2: Replace the comma by a full stop, dash, or slash. Example:

Replace this:
 
#01,08,2018#
 
With this:
 
#01.08.2018# or #01-08-2018# or #01/08/2018#

Cause

This behavior is due to the way Mac OS interprets dates.

Additional Information

The issue does not occur in applications running on Windows OS.


Discuss this article... Feedback Forum
Did this article resolve the issue?