NICK PANNERI, CFE
 
  • Home

Fixing NULL Dates in Tableau

8/30/2016

0 Comments

 
If you’re working in Tableau and using ‘live’ connections to SQL databases then you may have come across an issue where dates/times coming from SQL Server are appearing as NULL in Tableau.  I’ve pulled some resources together for hopefully a quick fix:

  • Tableau Knowledge base Post:  this post walks through reasons why your dates may be NULL and some options for using DATEPARSE along with an 'Extract' connection (rather than a live connection) to fix the issue.
    • The official ‘answer’ for this issue: The date/time field from the live data source is of type string. When using a live connection, Tableau Desktop relies on the remote database to perform the conversion from string to date or datetime. Because most databases do not handle these conversions uniformly, Tableau Desktop is unable to enforce a standard behavior.
  • Microsoft DATETIME2 Post:
  • ICU User Guide ​Post:  in my case, I particularly had an issue with a live connection to a SQL database using this date type.  These posts discuss the possible syntax you can use to describe the date in the Tableau DATEPARSE function you need to create
  • Tableau DATEPARSE Example:
    • My SQL Server date field was in this format:  2016-08-30 15:00:00.0000000
    • Here’s the Tableau DATEPARSE function I was able to create to successfully interpret the date:  DATEPARSE (“yyyy-MM-dd hh:mm:ss.0000000”, STR([DATETIME2_FIELD]))
The obvious downfall with this option is that it requires a copy of the data hosted locally.  When running Tableau desktop, it seems to also slow down performance. Hope this helps and good luck with your date fields in Tableau!

​
0 Comments



Leave a Reply.

    The views expressed in this blog are mine and do not necessarily reflect the views of Enterprise Holdings, Inc.

    Archives

    January 2017
    December 2016
    September 2016
    August 2016
    February 2015
    July 2014
    June 2014
    July 2013
    June 2013
    January 2013
    May 2012

    View my profile on LinkedIn

    RSS Feed

  • Home
  • Blog
Powered by Create your own unique website with customizable templates.