KNOWLEDGE BASE

Incorrect Results received When Wrapping Date Field in INT() or FLOAT() Type Conversion Functions


Published: 01 Feb 2017
Last Modified Date: 10 Feb 2017

Issue

When wrapping a date field in an INT() or FLOAT() function and using custom formatting to display the INT() or FLOAT() as a date, the result is two days prior to the actual date.

Environment

  • Tableau Desktop 10.1.0
  • Excel

Resolution

Use the DATE() function instead of special formatting of an INT() or FLOAT() in order to convert an integer to a date.

Cause

Wrapping the date in INT() or FLOAT() converts the date to its corresponding epoch date which uses the underlying data source's epoch start ("0" date). Therefore, using special formatting of an INT() function to create a date will use a different method to calculate the date from the epoch date.
Did this article resolve the issue?